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
91af3ae6
Commit
91af3ae6
authored
Oct 01, 2021
by
Axel García
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add OneTrust URL to content_security_policy
parent
3edf93fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
lib/gitlab/content_security_policy/config_loader.rb
lib/gitlab/content_security_policy/config_loader.rb
+2
-2
spec/lib/gitlab/content_security_policy/config_loader_spec.rb
.../lib/gitlab/content_security_policy/config_loader_spec.rb
+2
-2
No files found.
lib/gitlab/content_security_policy/config_loader.rb
View file @
91af3ae6
...
...
@@ -15,7 +15,7 @@ module Gitlab
directives
=
{
'default_src'
=>
"'self'"
,
'base_uri'
=>
"'self'"
,
'connect_src'
=>
"'self'"
,
'connect_src'
=>
"'self'
https://cdn.cookielaw.org
"
,
'font_src'
=>
"'self'"
,
'form_action'
=>
"'self' https: http:"
,
'frame_ancestors'
=>
"'self'"
,
...
...
@@ -23,7 +23,7 @@ module Gitlab
'img_src'
=>
"'self' data: blob: http: https:"
,
'manifest_src'
=>
"'self'"
,
'media_src'
=>
"'self'"
,
'script_src'
=>
"'strict-dynamic' 'self' 'unsafe-inline' 'unsafe-eval' https://www.google.com/recaptcha/ https://www.recaptcha.net https://apis.google.com"
,
'script_src'
=>
"'strict-dynamic' 'self' 'unsafe-inline' 'unsafe-eval' https://www.google.com/recaptcha/ https://www.recaptcha.net https://apis.google.com
https://cdn.cookielaw.org
"
,
'style_src'
=>
"'self' 'unsafe-inline'"
,
'worker_src'
=>
"'self' blob: data:"
,
'object_src'
=>
"'none'"
,
...
...
spec/lib/gitlab/content_security_policy/config_loader_spec.rb
View file @
91af3ae6
...
...
@@ -81,7 +81,7 @@ RSpec.describe Gitlab::ContentSecurityPolicy::ConfigLoader do
end
it
'adds CDN host to CSP'
do
expect
(
directives
[
'script_src'
]).
to
eq
(
"'strict-dynamic' 'self' 'unsafe-inline' 'unsafe-eval' https://www.google.com/recaptcha/ https://www.recaptcha.net https://apis.google.com https://example.com"
)
expect
(
directives
[
'script_src'
]).
to
eq
(
"'strict-dynamic' 'self' 'unsafe-inline' 'unsafe-eval' https://www.google.com/recaptcha/ https://www.recaptcha.net https://apis.google.com https://
cdn.cookielaw.org https://
example.com"
)
expect
(
directives
[
'style_src'
]).
to
eq
(
"'self' 'unsafe-inline' https://example.com"
)
expect
(
directives
[
'font_src'
]).
to
eq
(
"'self' https://example.com"
)
end
...
...
@@ -94,7 +94,7 @@ RSpec.describe Gitlab::ContentSecurityPolicy::ConfigLoader do
end
it
'adds sentry path to CSP without user'
do
expect
(
directives
[
'connect_src'
]).
to
eq
(
"'self' ws://example.com dummy://example.com/43"
)
expect
(
directives
[
'connect_src'
]).
to
eq
(
"'self'
https://cdn.cookielaw.org
ws://example.com dummy://example.com/43"
)
end
end
...
...
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