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
339015e2
Commit
339015e2
authored
Aug 07, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
07ce2643
eec1ed52
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
changelogs/unreleased/sh-add-missing-csp-report-uri.yml
changelogs/unreleased/sh-add-missing-csp-report-uri.yml
+5
-0
lib/gitlab/content_security_policy/config_loader.rb
lib/gitlab/content_security_policy/config_loader.rb
+1
-1
spec/lib/gitlab/content_security_policy/config_loader_spec.rb
.../lib/gitlab/content_security_policy/config_loader_spec.rb
+3
-1
No files found.
changelogs/unreleased/sh-add-missing-csp-report-uri.yml
0 → 100644
View file @
339015e2
---
title
:
Add missing report-uri to CSP config
merge_request
:
31593
author
:
type
:
fixed
lib/gitlab/content_security_policy/config_loader.rb
View file @
339015e2
...
...
@@ -5,7 +5,7 @@ module Gitlab
class
ConfigLoader
DIRECTIVES
=
%w(base_uri child_src connect_src default_src font_src
form_action frame_ancestors frame_src img_src manifest_src
media_src object_src script_src style_src worker_src)
.
freeze
media_src object_src
report_uri
script_src style_src worker_src)
.
freeze
def
self
.
default_settings_hash
{
...
...
spec/lib/gitlab/content_security_policy/config_loader_spec.rb
View file @
339015e2
...
...
@@ -13,7 +13,8 @@ describe Gitlab::ContentSecurityPolicy::ConfigLoader do
child_src:
"'self' https://child.example.com"
,
default_src:
"'self' https://other.example.com"
,
script_src:
"'self' https://script.exammple.com "
,
worker_src:
"data: https://worker.example.com"
worker_src:
"data: https://worker.example.com"
,
report_uri:
"http://example.com"
}
}
end
...
...
@@ -46,6 +47,7 @@ describe Gitlab::ContentSecurityPolicy::ConfigLoader do
expect
(
policy
.
directives
[
'default-src'
]).
to
eq
(
expected_config
(
:default_src
))
expect
(
policy
.
directives
[
'child-src'
]).
to
eq
(
expected_config
(
:child_src
))
expect
(
policy
.
directives
[
'worker-src'
]).
to
eq
(
expected_config
(
:worker_src
))
expect
(
policy
.
directives
[
'report-uri'
]).
to
eq
(
expected_config
(
:report_uri
))
end
it
'ignores malformed policy statements'
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