Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!