gpt4 book ai didi

javascript - 仅在托管应用程序时出现错误,但在本地主机中则不会出现错误

转载 作者:行者123 更新时间:2023-12-03 03:23:11 25 4
gpt4 key购买 nike

我一直在 AngularJS 2 中工作,在本地服务器中托管时没有错误,一切正常。但是当将其托管到 Firebase 服务器时,控制台中出现了一些错误。这是链接...:

https://test-calculadora.firebaseapp.com

错误

Google Chrome 和 Firefox 中出现此混合内容错误

Mixed Content: The page at 'https://test-calculadora.firebaseapp.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,300,600'. This request has been blocked; the content must be served over HTTPS.

此错误仅出现在 Google Chrome 中

ERROR TypeError: Cannot read property '0' of null
at Object.updateDirectives (3.ad64bef68a696aaec9de.chunk.js:1)
at Object.updateDirectives (vendor.be20388edeb374983d23.bundle.js:127)
at or (vendor.be20388edeb374983d23.bundle.js:127)
at mr (vendor.be20388edeb374983d23.bundle.js:127)
at gr (vendor.be20388edeb374983d23.bundle.js:127)
at or (vendor.be20388edeb374983d23.bundle.js:127)
at mr (vendor.be20388edeb374983d23.bundle.js:127)
at gr (vendor.be20388edeb374983d23.bundle.js:127)
at or (vendor.be20388edeb374983d23.bundle.js:127)
at mr (vendor.be20388edeb374983d23.bundle.js:127)

最佳答案

请注意出错的链接如何以“http”而不是“https”开头。 http 本质上是“不安全”的。

'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,300,600'

您应该能够向 http 添加一个“s”,这样就可以解决问题。

谷歌不得不说:

Always use https:// URLs when loading resources on your page. Use the Content-Security-Policy-Report-Only header to monitor mixed content errors on your site. Use the upgrade-insecure-requests CSP directive to protect your visitors from insecure content.

了解更多 here

关于javascript - 仅在托管应用程序时出现错误,但在本地主机中则不会出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46473426/

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