mozilla observatory retire bitch
This commit is contained in:
parent
175e313e03
commit
3be1b79b92
4
app.py
4
app.py
|
@ -74,7 +74,7 @@ limiter = Limiter(app, key_func=rate_limit_key)
|
|||
|
||||
@app.after_request
|
||||
def install_security_headers(resp):
|
||||
csp = "default-src 'none'; img-src 'self' https: http:; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self'; frame-ancestors 'none'"
|
||||
csp = "default-src 'none'; img-src 'self' https:; upgrade-insecure-requests; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self'; frame-ancestors 'none'"
|
||||
if 'CSP_REPORT_URI' in app.config:
|
||||
csp += "; report-uri " + app.config.get('CSP_REPORT_URI')
|
||||
resp.headers.set('Content-Security-Policy', csp)
|
||||
|
@ -85,6 +85,6 @@ def install_security_headers(resp):
|
|||
resp.headers.set('referrer-policy', 'no-referrer')
|
||||
resp.headers.set('x-content-type-options', 'nosniff')
|
||||
resp.headers.set('x-frame-options', 'DENY')
|
||||
resp.headers.set('x-xss-protection', '0')
|
||||
resp.headers.set('x-xss-protection', '1')
|
||||
|
||||
return resp
|
||||
|
|
Loading…
Reference in New Issue