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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
e0ffbf0e
Commit
e0ffbf0e
authored
Jul 05, 2016
by
Connor Shea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the CSP reporting URI of Sentry.
parent
e5d6f333
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
config/initializers/secure_headers.rb
config/initializers/secure_headers.rb
+8
-1
No files found.
config/initializers/secure_headers.rb
View file @
e0ffbf0e
require
'gitlab/current_settings'
include
Gitlab
::
CurrentSettings
uri
=
URI
.
parse
(
current_application_settings
.
sentry_dsn
)
CSP_REPORT_URI
=
"
#{
uri
.
scheme
}
://
#{
uri
.
host
}
/api
#{
uri
.
path
}
/csp-report/?sentry_key=
#{
uri
.
user
}
"
SecureHeaders
::
Configuration
.
default
do
|
config
|
config
.
cookies
=
{
secure:
true
,
# mark all cookies as "Secure"
...
...
@@ -33,6 +40,6 @@ SecureHeaders::Configuration.default do |config|
frame_ancestors:
%w('none')
,
block_all_mixed_content:
true
,
# see http://www.w3.org/TR/mixed-content/
upgrade_insecure_requests:
true
,
# see https://www.w3.org/TR/upgrade-insecure-requests/
report_uri:
%
w(''
)
report_uri:
%
W(
#{
CSP_REPORT_URI
}
)
}
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