Denis
Denis

Reputation: 29

Access-Control-Allow-Origin in Flask

I am using Flask to run two server on my localhost. One on port 40000 and the other on 50000. I have an HTML5 application running on localhost:50000. Now I want to send GET xml-http-requests to the server with port 40000.

I know this is not working because of the Same Origin Policy. Do I have to set "Access-Control-Allow-Origin: *" on my Flask server with port 50000?

Upvotes: 0

Views: 513

Answers (1)

Quentin
Quentin

Reputation: 943100

No.

You have to set Access-Control-Allow-Origin on the server the request is being made to. i.e. the server running on port 40000.

The server which already has the data must grant permission to the page on the other server to read that data.

Upvotes: 1

Related Questions