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
38577d68
Commit
38577d68
authored
Jul 19, 2016
by
Connor Shea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the Sentry spam from CSP violations by disabling it.
parent
f2cd21e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
12 deletions
+2
-12
config/initializers/secure_headers.rb
config/initializers/secure_headers.rb
+2
-12
No files found.
config/initializers/secure_headers.rb
View file @
38577d68
...
...
@@ -4,14 +4,7 @@
require
'gitlab/current_settings'
include
Gitlab
::
CurrentSettings
# If Sentry is enabled and the Rails app is running in production mode,
# this will construct the Report URI for Sentry.
if
Rails
.
env
.
production?
&&
current_application_settings
.
sentry_enabled
uri
=
URI
.
parse
(
current_application_settings
.
sentry_dsn
)
CSP_REPORT_URI
=
"
#{
uri
.
scheme
}
://
#{
uri
.
host
}
/api
#{
uri
.
path
}
/csp-report/?sentry_key=
#{
uri
.
user
}
"
else
CSP_REPORT_URI
=
''
end
CSP_REPORT_URI
=
''
# Content Security Policy Headers
# For more information on CSP see:
...
...
@@ -71,10 +64,7 @@ SecureHeaders::Configuration.default do |config|
upgrade_insecure_requests:
true
}
# Reports are sent to Sentry if it's enabled.
if
current_application_settings
.
sentry_enabled
config
.
csp
[
:report_uri
]
=
%W(
#{
CSP_REPORT_URI
}
)
end
# Allow Bootstrap Linter in development mode.
if
Rails
.
env
.
development?
...
...
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