我是相当接近放弃移动应用引擎。
目前我无法从我的服务器访问任何静态文件,因为应用程序引擎设置了一些content-security-policy头,在本地或计算引擎上运行时我没有体验到这些情况。
我只是试图访问我的静态文件夹。
误差
The Content Security Policy directive 'default-src' contains 'frame-ancestors' as a source expression. Did you mean 'default-src ...; frame-ancestors...' (note the semicolon)?响应头
alt-svc: quic=":443"; ma=2592000; v="43,42,41,39,35"
content-encoding: gzip
content-security-policy: default-src 'self' frame-ancestors 'self' https://console.cloud.google.com https://*.corp.google.com:* http://*.corp.google.com:*
content-type: text/html; charset=utf-8
date: Tue, 26 Jun 2018 09:53:17 GMT
server: nginx/1.10.3
status: 404
vary: Accept-Encoding
via: 1.1 google
x-content-type-options: nosniff
x-powered-by: Express我可以看到CSP有问题,但我不确定我需要做什么来影响这件事.
我使用的是灵活的环境,使用的是Express和Nodejs,应用程序托管在@ https://my-project-dot-blha.appspot.com
UPDATE:虽然我可以看到这很可能是语法错误,但我正在尝试将标题设置为express,但无法设置,如果有人知道如何影响这些应用程序引擎的头部,那将是王牌!
提前谢谢。
发布于 2018-06-27 16:32:53
解决了!
当使用应用程序引擎web预览时,GAE服务器设置了内容安全策略,以确保您不共享或使用这些预览域。它们允许用户从控制台环境中打开它。
如果您想绕过它,可以使用:https://chrome.google.com/webstore/detail/disable-content-security/ieelmcmcagommplceebfedjlakkhpden?hl=en
否则,当我将应用程序部署到prod环境时,这个问题就不存在了!
https://stackoverflow.com/questions/51040045
复制相似问题