首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Content-Security-Policy :允许框架祖先域不工作

Content-Security-Policy :允许框架祖先域不工作
EN

Stack Overflow用户
提问于 2019-04-15 21:01:14
回答 1查看 1.7K关注 0票数 0

我想在我的OpenStreetMap网页中嵌入PHP;但我在任何web浏览器中都会遇到这样的错误:

代码语言:javascript
复制
Content Security Policy: « x-frame-options » ignored due to the directive « frame-ancestors ».

然而,我确实添加了以下代码:

代码语言:javascript
复制
header( 'Content-Security-Policy: frame-ancestors openstreetmap.org' ) ;

我也在这里寻找(但它没有帮助):

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors

https://developer.mozilla.org/fr/docs/Web/HTTP/Headers/X-Frame-Options

https://openweb.eu.org/articles/content-security-policy (法语)

怎么了?

谢谢

EN

回答 1

Stack Overflow用户

发布于 2019-04-16 20:18:45

解决方案是嵌入正确的url!

这个是错误的:

代码语言:javascript
复制
https://www.openstreetmap.org/#map=11/48.8589/2.3469

但这一条没问题:

代码语言:javascript
复制
https://www.openstreetmap.org/export/embed.html?bbox=2.115554809570313%2C48.746228791937774%2C2.578353881835938%2C48.97165373099147

就是这样!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55689782

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档