mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
@@ -359,10 +359,10 @@ def useful_headers_after_request(response):
|
|||||||
response.headers.add('X-XSS-Protection', '1; mode=block')
|
response.headers.add('X-XSS-Protection', '1; mode=block')
|
||||||
response.headers.add('Content-Security-Policy', (
|
response.headers.add('Content-Security-Policy', (
|
||||||
"default-src 'self' 'unsafe-inline';"
|
"default-src 'self' 'unsafe-inline';"
|
||||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' data:;"
|
"script-src 'self' *.google-analytics.com 'unsafe-inline' 'unsafe-eval' data:;"
|
||||||
"object-src 'self';"
|
"object-src 'self';"
|
||||||
"font-src 'self' data:;"
|
"font-src 'self' data:;"
|
||||||
"img-src 'self' *.notifications.service.gov.uk data:;"
|
"img-src 'self' *.google-analytics.com *.notifications.service.gov.uk data:;"
|
||||||
))
|
))
|
||||||
if 'Cache-Control' in response.headers:
|
if 'Cache-Control' in response.headers:
|
||||||
del response.headers['Cache-Control']
|
del response.headers['Cache-Control']
|
||||||
|
|||||||
@@ -129,4 +129,12 @@
|
|||||||
|
|
||||||
{% block body_end %}
|
{% block body_end %}
|
||||||
<script type="text/javascript" src="{{ asset_url('javascripts/all.js') }}" /></script>
|
<script type="text/javascript" src="{{ asset_url('javascripts/all.js') }}" /></script>
|
||||||
|
<script>
|
||||||
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||||
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||||
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
ga('create', 'UA-75215134-1', 'auto');
|
||||||
|
ga('send', 'pageview');
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ def test_owasp_useful_headers_set(app_):
|
|||||||
assert response.headers['X-XSS-Protection'] == '1; mode=block'
|
assert response.headers['X-XSS-Protection'] == '1; mode=block'
|
||||||
assert response.headers['Content-Security-Policy'] == (
|
assert response.headers['Content-Security-Policy'] == (
|
||||||
"default-src 'self' 'unsafe-inline';"
|
"default-src 'self' 'unsafe-inline';"
|
||||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' data:;"
|
"script-src 'self' *.google-analytics.com 'unsafe-inline' 'unsafe-eval' data:;"
|
||||||
"object-src 'self';"
|
"object-src 'self';"
|
||||||
"font-src 'self' data:;"
|
"font-src 'self' data:;"
|
||||||
"img-src 'self' *.notifications.service.gov.uk data:;"
|
"img-src 'self' *.google-analytics.com *.notifications.service.gov.uk data:;"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user