CSP: Add reporting endpoint

This commit is contained in:
Raphael Michel
2017-09-28 18:43:45 +02:00
parent c030bd35ca
commit 29b157f287
5 changed files with 41 additions and 1 deletions

View File

@@ -192,6 +192,7 @@ class SecurityMiddleware(MiddlewareMixin):
# single-sign-on this can be nearly anything so we cannot really restrict
# this. However, we'll restrict it to HTTPS.
'form-action': ["{dynamic}", "https:"],
'report-uri': ["/csp_report/"],
}
if 'Content-Security-Policy' in resp:
_merge_csp(h, _parse_csp(resp['Content-Security-Policy']))