gpt4 book ai didi

javascript - 谷歌地图身份验证不起作用,内容安全策略指令

转载 作者:行者123 更新时间:2023-11-28 01:13:26 26 4
gpt4 key购买 nike

我有一个 Ruby on Rails 应用程序。今天检查后,我发现我的谷歌地图脚本停止工作...当我查看控制台时,很多错误开始显示应用程序

我正在本地计算机上工作,但问题也出在部署的应用程序上。2-3 天前一切正常

使用 git 回滚到旧版本没有帮助。

我找到了this article相关吗?

控制台错误

[Report Only] Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src https://* 'self'".

[Report Only] Refused to execute inline script because it violates the following Content Security Policy directive: "script-src https://* 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.

[Report Only] Refused to load the script 'http://maps.gstatic.com/cat_js/intl/en_us/mapfiles/api-3/15/18/%7Bcommon,util,stats%7D.js' because it violates the following Content Security Policy directive: "script-src https://* 'self'".

[Report Only] Refused to load the script 'http://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1…%2Fstore%2Fentertainment_categories&5e1&callback=xdc._dxjdl0&token=95186' because it violates the following Content Security Policy directive: "script-src https://* 'self'".

最佳答案

我使用 gem“secure_headers”,但没有遵循安全先决条件,因此它阻止了 Google map 。

正在删除 secure_headers问题解决了。

您可能会使用其他安全库阻止 Google map 。

关于javascript - 谷歌地图身份验证不起作用,内容安全策略指令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24150597/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com