CORS error on same domain?
I'm running into a weird CORS issue right now.
Here's the error message:
XMLHttpRequest cannot load http://localhost:8666/routeREST/select?q=[...] Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin
- localhost:8666/routeREST/ : this is a simple Python Bottle server.
Any thought on what could be the problem?
And... the port was the problem. Thanks for your answers :)
If anyone is using a Python bottle server as well, you can follow the answer given on this post to solve the CORS issue: Bottle Py: Enabling CORS for jQuery AJAX requests
It is only considered to be the same if the protocol , host and port is the same: Same Origin Policy
You need to add Access-Control-Allow-Origin as a header in your response. To allow everyone (you should probably NOT do that):
★ Back to homepage or read more recommendations: