【发布时间】:2021-09-08 10:17:52
【问题描述】:
我正在尝试通过 _headers 文件将内容安全策略添加到我的 Gatsby x Netlify 网站。一切正常,除了不想显示的 Matterport iFrame。我在控制台看到的错误信息是
Refused to frame 'https://my.matterport.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".
在我的头文件中,我添加了以下 X-Frame-Options:
X-Frame-Options: ALLOW-FROM https://*.matterport.com/
我的内容安全政策中也有这个frame-src:
frame-src 'self' https://www.youtube.com/ https://my.matterport.com https://matterport.com;
但 iFrame 仍然看起来像这样: Matterport iFrames not displaying
谁能帮我弄清楚我在这里做错了什么?
谢谢!
【问题讨论】:
标签: security iframe netlify matterport