Closed omargourari closed 5 years ago
The headers
property sets request headers. To allow a crossdomain request on your server you have to set the response headers on your server. In PHP this looks like this:
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: OPTIONS, GET, DELETE, POST');
Hello everyone, I'm having a hard time allowing CORS requests from Filepond client library to a python/gunicorn backend
Here below the Filepond component:
Requesting request headers:
Output error:
Access to XMLHttpRequest at 'http://127.0.0.1:5000/upload' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource
Expected behaviour Requests correctly reach the backend allowing cors requests (and possibly also get rid of the OPTIONS call)
Environment and Version OS MacOS High Siera 10.13.6 Browser Google Chrome Version 70.0.3538.110 (Official Build) (64-bit)