mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 08:28:15 -04:00
Merge pull request #67 from alphagov/content-security
Added content security policy header.
This commit is contained in:
@@ -123,6 +123,8 @@ def useful_headers_after_request(response):
|
|||||||
response.headers.add('X-Frame-Options', 'deny')
|
response.headers.add('X-Frame-Options', 'deny')
|
||||||
response.headers.add('X-Content-Type-Options', 'nosniff')
|
response.headers.add('X-Content-Type-Options', 'nosniff')
|
||||||
response.headers.add('X-XSS-Protection', '1; mode=block')
|
response.headers.add('X-XSS-Protection', '1; mode=block')
|
||||||
|
response.headers.add('Content-Security-Policy',
|
||||||
|
"default-src 'self' 'unsafe-inline'")
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,3 +6,4 @@ def test_owasp_useful_headers_set(notifications_admin):
|
|||||||
assert response.headers['X-Frame-Options'] == 'deny'
|
assert response.headers['X-Frame-Options'] == 'deny'
|
||||||
assert response.headers['X-Content-Type-Options'] == 'nosniff'
|
assert response.headers['X-Content-Type-Options'] == 'nosniff'
|
||||||
assert response.headers['X-XSS-Protection'] == '1; mode=block'
|
assert response.headers['X-XSS-Protection'] == '1; mode=block'
|
||||||
|
assert response.headers['Content-Security-Policy'] == "default-src 'self' 'unsafe-inline'" # noqa
|
||||||
|
|||||||
Reference in New Issue
Block a user