mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Fixed broken Django error pages due to CSP headers
This commit is contained in:
@@ -147,6 +147,11 @@ class SecurityMiddleware:
|
||||
return "; ".join(k + ' ' + v for k, v in h.items())
|
||||
|
||||
def process_response(self, request, resp):
|
||||
if settings.DEBUG and resp.status_code >= 400:
|
||||
# Don't use CSP on debug error page as it breaks of Django's fancy error
|
||||
# pages
|
||||
return resp
|
||||
|
||||
resp['X-XSS-Protection'] = '1'
|
||||
h = {
|
||||
'default-src': "{static}",
|
||||
|
||||
Reference in New Issue
Block a user