我对CSP很陌生,我想在一个酒瓶网站上使用Talisman .复杂的Adobe字体,这似乎是CSP-厌恶。也就是说,站点可以工作,可以加载Adobe字体,等等。
但是,Web控制台显示了以下消息:
Content Security Policy: Interpreting unsafe-inline as a hostname, not a keyword. If you intended this to be a keyword, use ‘unsafe-inline’ (wrapped in single quotes).
Content Security Policy: Interpreting none as a hostname, not a keyword. If you intended this to be a keyword, use ‘none’ (wrapped in single quotes).我的CSP看起来是这样的:
SELF = "'self'"
csp = {
'default-src': SELF,
'script-src': [
SELF,
'use.typekit.net',
'cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js',
],
'style-src': [SELF, 'unsafe-inline', 'use.typekit.net'],
'font-src': [SELF, 'use.typekit.net'],
'img-src': [SELF, 'p.typekit.net'],
'object-src': 'none',
}
app = Flask(__name__)
talisman = Talisman(app, content_security_policy=csp)就像我说的,这是可行的,但这些错误是令人不安的。我试过所有单引号双引号没有引号的组合..。毫无办法。任何帮助都将不胜感激!
发布于 2020-08-22 17:41:37
https://stackoverflow.com/questions/63454520
复制相似问题