mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-04 05:31:44 -04:00
Allow images to be served from live domain
Currently images in our email template are hardcoded to be served from the live domain[1]. In order for the admin app, running locally or in preview/staging, to be able to load these images when previewing an email template, the CSP headers need to allow this domain. Also splits the header string up using string literal concatenation[2] so that it’s easier to read. 1. https://notifications.service.gov.uk 2. https://docs.python.org/3/reference/lexical_analysis.html#string-literal-concatenation
This commit is contained in:
@@ -6,4 +6,10 @@ def test_owasp_useful_headers_set(app_):
|
||||
assert response.headers['X-Frame-Options'] == 'deny'
|
||||
assert response.headers['X-Content-Type-Options'] == 'nosniff'
|
||||
assert response.headers['X-XSS-Protection'] == '1; mode=block'
|
||||
assert response.headers['Content-Security-Policy'] == "default-src 'self' 'unsafe-inline'; script-src 'self' *.google-analytics.com 'unsafe-inline' data:; object-src 'self'; font-src 'self' data:; img-src 'self' *.google-analytics.com data:;" # noqa
|
||||
assert response.headers['Content-Security-Policy'] == (
|
||||
"default-src 'self' 'unsafe-inline';"
|
||||
"script-src 'self' *.google-analytics.com 'unsafe-inline' data:;"
|
||||
"object-src 'self';"
|
||||
"font-src 'self' data:;"
|
||||
"img-src 'self' *.google-analytics.com *.notifications.service.gov.uk data:;"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user