mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-19 04:36:32 -04:00
Merge pull request #1612 from alphagov/fix-analytics-csp
Stop content security policy blocking GA
This commit is contained in:
@@ -441,6 +441,7 @@ def useful_headers_after_request(response):
|
||||
response.headers.add('Content-Security-Policy', (
|
||||
"default-src 'self' 'unsafe-inline';"
|
||||
"script-src 'self' *.google-analytics.com 'unsafe-inline' 'unsafe-eval' data:;"
|
||||
"connect-src 'self' *.google-analytics.com;"
|
||||
"object-src 'self';"
|
||||
"font-src 'self' data:;"
|
||||
"img-src 'self' *.google-analytics.com *.notifications.service.gov.uk {} data:;"
|
||||
|
||||
@@ -10,6 +10,7 @@ def test_owasp_useful_headers_set(client, mocker):
|
||||
assert response.headers['Content-Security-Policy'] == (
|
||||
"default-src 'self' 'unsafe-inline';"
|
||||
"script-src 'self' *.google-analytics.com 'unsafe-inline' 'unsafe-eval' data:;"
|
||||
"connect-src 'self' *.google-analytics.com;"
|
||||
"object-src 'self';"
|
||||
"font-src 'self' data:;"
|
||||
"img-src 'self' *.google-analytics.com *.notifications.service.gov.uk static-logos.test.com data:;"
|
||||
|
||||
Reference in New Issue
Block a user