Content-Security-Policy:允许frame-ancestors域无法正常工作

问题描述 投票:0回答:1

我想在我的PHP网页中嵌入一个OpenStreetMap iframe;但我在任何网络浏览器中都有这种错误:

Content Security Policy: « x-frame-options » ignored due to the directive « frame-ancestors ».

但我确实添加了这段代码:

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(法文)

怎么了? 感谢名单

php content-security-policy
1个回答
0
投票

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

这个错了:

https://www.openstreetmap.org/#map=11/48.8589/2.3469

但是这个还可以:

https://www.openstreetmap.org/export/embed.html?bbox=2.115554809570313%2C48.746228791937774%2C2.578353881835938%2C48.97165373099147

而已 !

© www.soinside.com 2019 - 2024. All rights reserved.