Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

295
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda