我想在我的OpenStreetMap网页中嵌入PHP;但我在任何web浏览器中都会遇到这样的错误:
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 (法语)
怎么了?
谢谢
发布于 2019-04-16 20:18:45
解决方案是嵌入正确的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就是这样!
https://stackoverflow.com/questions/55689782
复制相似问题