Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

296
Visualizações
my firebase web app is not enabling cors in my firebase.json file

firebase.json file:

{
  "hosting": {
    "public": "public",
    "cleanUrls": true,
    "headers": [
      {
        "source": "**",
        "headers": [
          {
            "key": "Access-Control-Allow-Origin",
            "value": "*"
          }
        ]
      }
    ]
  }
}

I Thought this would have fixed the issue but from my main page index.html, but when i use the code, it still blocked do to cores policy and i dont have the budget to get firebase functions right now but i got the firebase.json code from another post but it didnt help:

function download_file(val, filename) {
    var storage = firebase.storage();
    
    
    storage.ref(val).getDownloadURL().then(function(url) {
      // `url` is the download URL for 'images/stars.jpg'
    
      alert(url, filename)
      

      // This can be downloaded directly:
    var xhr = new XMLHttpRequest();
    xhr.responseType = 'blob';
    xhr.onload = (event) => {
      var blob = xhr.response;
    };
    xhr.open('GET', url);
    xhr.send();
      
    
     
    }).catch(function(error) {
      console.log(error)
    });
  }

PLEASE dont close this post, instead ill mark it fixed, i dont wanna get banned from it so please... I Got My Code From Here: LINK[Stack Overflow Post][1]

[1]: Access-Control-Allow-Origin added to firebase.json but missing from the file response header But its not working...

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda