Firebase托管聚合物ERR_INSECURE_RESPONSE

时间:2016-10-19 12:26:09

标签: firebase polymer firebase-hosting

AskFirebase

该应用程序在localHost上运行良好,但在部署到firebase时,我得到了favicon和带有空白屏幕的选项卡名称。

控制台出错: 获取https://graphite-proton-861.firebaseapp.com/service-worker.js net :: ERR_INSECURE_RESPONSE

我跟着 https://www.polymer-project.org/1.0/start/toolbox/deploy

1 个答案:

答案 0 :(得分:0)

Whats in your firebase.json? You will need to supply the correct header "Access-Control-Allow-Origin" (research CORS). This is what I use in a project which can be called from any domain:

{
  "firebase": "fiery-torch-XXXX-yourref",
  "headers": [ {
    "source" : "**",
    "headers" : [ {
      "key" : "Access-Control-Allow-Origin",
      "value" : "*"
    } ]
  } ],
  "public": ".",
  "ignore": [
    "firebase.json",
    "**/.*",
    "**/node_modules/**"
  ]
}