仅在托管应用程序时出错,但在我的本地主机中不出错

Errors only when hosting app but not in my local host

我一直在 AngularJS 2 工作,在本地服务器上托管时我没有任何错误,并且在将其托管到 firebase 服务器时一切都是 okey.But 控制台中出现一些错误。这是 link...:[=​​13=]

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)

请注意错误的 link 是如何以 'http' 而不是 'https' 开头的。 http 本质上是 'insecure'.

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

您应该可以向 http 添加一个 's',这应该可以解决问题。

google 的评价:

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