Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5341e159
Commit
5341e159
authored
May 24, 2021
by
dcouture
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with frames not loading in Safari
Changelog: fixed
parent
651e2504
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
lib/gitlab/content_security_policy/config_loader.rb
lib/gitlab/content_security_policy/config_loader.rb
+5
-1
spec/lib/gitlab/content_security_policy/config_loader_spec.rb
.../lib/gitlab/content_security_policy/config_loader_spec.rb
+1
-0
No files found.
lib/gitlab/content_security_policy/config_loader.rb
View file @
5341e159
...
...
@@ -14,7 +14,6 @@ module Gitlab
'directives'
=>
{
'default_src'
=>
"'self'"
,
'base_uri'
=>
"'self'"
,
'child_src'
=>
"'none'"
,
'connect_src'
=>
"'self'"
,
'font_src'
=>
"'self'"
,
'form_action'
=>
"'self' https: http:"
,
...
...
@@ -31,6 +30,11 @@ module Gitlab
}
}
# frame-src was deprecated in CSP level 2 in favor of child-src
# CSP level 3 "undeprecated" frame-src and browsers fall back on child-src if it's missing
# However Safari seems to read child-src first so we'll just keep both equal
settings_hash
[
'directives'
][
'child_src'
]
=
settings_hash
[
'directives'
][
'frame_src'
]
allow_webpack_dev_server
(
settings_hash
)
if
Rails
.
env
.
development?
allow_cdn
(
settings_hash
)
if
ENV
[
'GITLAB_CDN_HOST'
].
present?
...
...
spec/lib/gitlab/content_security_policy/config_loader_spec.rb
View file @
5341e159
...
...
@@ -35,6 +35,7 @@ RSpec.describe Gitlab::ContentSecurityPolicy::ConfigLoader do
expect
(
directives
.
has_key?
(
'report_uri'
)).
to
be_truthy
expect
(
directives
[
'report_uri'
]).
to
be_nil
expect
(
directives
[
'child_src'
]).
to
eq
(
directives
[
'frame_src'
])
end
context
'when GITLAB_CDN_HOST is set'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment