csp: support old browsers without style-src-attr
This commit is contained in:
parent
58a14c4ab0
commit
f0929c6bab
1 changed files with 4 additions and 3 deletions
7
app.py
7
app.py
|
@ -101,14 +101,15 @@ csrf.init_app(app)
|
|||
csp = {
|
||||
"default-src": "'self'",
|
||||
"style-src-attr": "'unsafe-inline'",
|
||||
"script-src": "'self'", # to use nonce
|
||||
"style-src": "'self'", # to use nonce
|
||||
"script-src": "'self'", # to use nonce
|
||||
"style-src": "'unsafe-inline'", # for old browsers without support style-src-attr
|
||||
"style-src-elem": "'self'",
|
||||
}
|
||||
|
||||
talisman = Talisman(
|
||||
app,
|
||||
content_security_policy=csp,
|
||||
force_https=False, # internal requests like /tasks/* are sent over HTTP
|
||||
force_https=False, # internal requests like /tasks/* are sent over HTTP
|
||||
content_security_policy_nonce_in=["script-src", "style-src"],
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue