Commit 51513117 authored by captainwong's avatar captainwong

fix baidu tongji

parent 5cfc3d97
Pipeline #93 canceled with stages
...@@ -82,9 +82,9 @@ except ImportError: ...@@ -82,9 +82,9 @@ except ImportError:
@app.after_request @app.after_request
def add_security_headers(resp): def add_security_headers(resp):
resp.headers['Content-Security-Policy'] = "default-src 'self' 'unsafe-inline' 'unsafe-eval'; font-src 'self' data:; img-src 'self' data:" #resp.headers['Content-Security-Policy'] = "default-src 'self' 'unsafe-inline' 'unsafe-eval'; font-src 'self' data:; img-src 'self' data:"
if request.endpoint == "editbook.edit_book" or config.config_use_google_drive: #if request.endpoint == "editbook.edit_book" or config.config_use_google_drive:
resp.headers['Content-Security-Policy'] += " *" # resp.headers['Content-Security-Policy'] += " *"
resp.headers['Content-Security-Policy'] += ";script-src 'self' https://hm.baidu.com 'unsafe-inline' 'unsafe-eval';" resp.headers['Content-Security-Policy'] += ";script-src 'self' https://hm.baidu.com 'unsafe-inline' 'unsafe-eval';"
resp.headers['X-Content-Type-Options'] = 'nosniff' resp.headers['X-Content-Type-Options'] = 'nosniff'
resp.headers['X-Frame-Options'] = 'SAMEORIGIN' resp.headers['X-Frame-Options'] = 'SAMEORIGIN'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment