Clean up CSP a little more to work properly with Analytics. (#698)
This commit is contained in:
parent
75edfe8b31
commit
7b12fba945
3 changed files with 4 additions and 6 deletions
|
@ -52,10 +52,10 @@ def teardown_request(error):
|
|||
@app.after_request
|
||||
def after_request(response: Response):
|
||||
response.headers.add("Content-Security-Policy", (
|
||||
"script-src 'self' 'unsafe-inline';"
|
||||
" connect-src 'self' *.google-analytics.com *.analytics.google.com;"
|
||||
" object-src 'none';"
|
||||
" img-src 'self' *.google-analytics.com *.analytics.google.com"
|
||||
" script-src: 'self' https://*.googletagmanager.com"
|
||||
" img-src: https://*.google-analytics.com https://*.googletagmanager.com"
|
||||
" connect-src: 'self' https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com"
|
||||
" object-src: 'none'"
|
||||
))
|
||||
response.headers.add("Strict-Transport-Security", "max-age=31536000")
|
||||
response.headers.add("X-Frame-Options", "deny")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue