0

i am building a web app using angularjs and am using firebase as my database and storage.

my issue is that i am trying to get a .txt file from my storage and display it in the browser, but whenever i make a request using the download url that i got using the firebase sdk i get a cors error.

i am authenticated in firebaseAuth and i have already been able to download images via the 'src' attribute.

this is my request:

$http({
        url: url,
        method: 'GET'
    }).then(function(data){
        console.log(data);
    }).catch(function(e){
        console.log(e)
    });

I don't want to override the cors options if i don't have to. does anyone know how i can do this?

I am using firebase hosting to host the site, which shares the same url as my firebase storage

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
BelgishChoko
  • 393
  • 2
  • 12
  • 1
    Possible duplicate of [Firebase Storage and Access-Control-Allow-Origin](http://stackoverflow.com/questions/37760695/firebase-storage-and-access-control-allow-origin) – Mike McDonald Aug 30 '16 at 16:15
  • I have seen this post and it seems unlikely that I should have to alter my options. Especially since I'm using firebase's own hosting service which shares the same url as the storage – BelgishChoko Aug 30 '16 at 16:37
  • 1
    We don't automatically set up CORS, so you will actually have to set up CORS even if you're using our hosting option. In the future, we plan on adding our standard *.firebaseapp.com domain to the default CORS so you won't have to. – Mike McDonald Aug 30 '16 at 19:02

1 Answers1

0

OK. Thanks Mike Macdonald for your comment. I'll just do what it says in the other thread you sent me

BelgishChoko
  • 393
  • 2
  • 12