Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Admin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osuny
Admin
Commits
30de0806
Unverified
Commit
30de0806
authored
1 year ago
by
Sébastien Gaya
Browse files
Options
Downloads
Patches
Plain Diff
iframe host
parent
35a48041
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/models/communication/website/with_security.rb
+1
-2
1 addition, 2 deletions
app/models/communication/website/with_security.rb
app/services/video/provider/default.rb
+7
-3
7 additions, 3 deletions
app/services/video/provider/default.rb
with
8 additions
and
5 deletions
app/models/communication/website/with_security.rb
+
1
−
2
View file @
30de0806
...
...
@@ -33,8 +33,7 @@ module Communication::Website::WithSecurity
blocks
.
where
(
template_kind: :video
).
each
do
|
block
|
video_url
=
block
.
template
.
url
next
unless
video_url
.
present?
video_iframe_url
=
Video
::
Provider
.
find
(
video_url
).
iframe_url
list
<<
URI
.
parse
(
video_iframe_url
).
host
list
<<
Video
::
Provider
.
find
(
video_url
).
iframe_host
end
list
end
...
...
This diff is collapsed.
Click to expand it.
app/services/video/provider/default.rb
+
7
−
3
View file @
30de0806
class
Video::Provider::Default
DOMAINS
=
[]
attr_reader
:video_url
include
ActionView
::
Helpers
::
TagHelper
...
...
@@ -17,6 +17,10 @@ class Video::Provider::Default
video_url
end
def
iframe_host
URI
.
parse
(
iframe_url
).
host
end
def
iframe_tag
(
**
iframe_options
)
content_tag
(
:iframe
,
nil
,
default_iframe_options
.
merge
(
iframe_options
))
end
...
...
@@ -36,8 +40,8 @@ class Video::Provider::Default
protected
def
url_in_domains?
self
.
class
::
DOMAINS
.
any?
do
|
domain
|
video_url
.
include?
(
domain
)
self
.
class
::
DOMAINS
.
any?
do
|
domain
|
video_url
.
include?
(
domain
)
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment