bobpardoe
bobpardoe

Reputation: 47

Aurelia Fetch CORS Not working on localhost with Chrome or Firefox

Here is my pre-flight request.

enter image description here

I have set the Access-Control-Allow-Origin but neither browser can see it so the subsequent request fails

This is what I then get on the failed request

      Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8080/api/v1.0/currencies/2. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

Upvotes: 0

Views: 564

Answers (1)

Ashley Grant
Ashley Grant

Reputation: 10897

Your "Access-Control-Allow-Origin" is set to "http://localhost:9000" but you are making a request to "http://loclahost:8080". Given that this is an Aurelia app, I'm guessing it's being served from localhost:9000, so you'll need to update your code where you set the ACAO header.

Upvotes: 1

Related Questions