No Access-Control-Allow-Origin on resource when requesting via AJAX
See original GitHub issuePhoton worked fine until recently. But now we’re getting this error in Chrome:
Access to XMLHttpRequest at ‘https://photon.komoot.de/api/?q=erlangen’ from <domain> has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
The strange thing is: the header is present if we use Postman, but accessing photon via the axios
library fails now.
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Jquery AJAX: No 'Access-Control-Allow-Origin' header is ...
I am trying to post data to an API from my localhost:4502 port. When i tried to post data to this API using...
Read more >How to Make a Cross-origin Ajax Request - Webucator
Cross -origin Resource Sharing (CORS) is a mechanism for requesting fonts, scripts, and other resources from an origin (defined, as above, as the...
Read more >AJAX - No 'Access-Control-Allow-Origin' header error, despite ...
Access-Control-Allow-Origin header is something you cannot append with your request. It's the server's response that will add it, assuming your ...
Read more >Error: No 'Access-Control-Allow-Origin' Header is Present
Recently I came across a situation where I was making a simple Ajax call using the “Get” method and few data, to an...
Read more >No 'Access-Control-Allow-Origin' header is present on the ...
I am calling rest api “https://something.com/EmpEmployment?xxxxx” form JIRA plugin using jquery. But i am getting Error"No 'Access-Control-Allow ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JorgenG You need CORS headers along the whole redirection chain. At least that was the only way I could make it work. You can simply test this with the photon webiste from this repo. Check out the repo, copy
website/config.js.example
towebsite/photon/config.js
. Editwebsite/photon/config.js
and change the API_URL to'https://photon.komoot.de/api/?'
. Then openwebsite/photon/index.html
in your browser. Type something in the search box and you’ll see that the request already fails on the OPTIONS call to photon.komoot.de.@lonvia Ah, thanks a lot for the elaboration. Apologies for having misunderstood this and potentially broken it for web ui clients. I made the wrong assumption that web client redirects would only care about CORS for the “end” destination, i.e. the redirected target. I’ll redirect the traffic back to the server as before and continue investigating a proper solution.