Open AdolfoRoquero opened 1 year ago
Does this URL http://127.0.0.1:5000/manager/personnel
exist on your backend app? Can you verify it's http://127.0.0.1:5000/manager/personnel
without /
at the end ?
same problem, with or without "/" at the end
Seems related to this unresolved issue. I will update this comment if I can figure it out.
I am using React for the front-end running on 'http://localhost:3000' and Flask for the backend running on http://127.0.0.1:5000. I am running into the following error
Access to XMLHttpRequest at 'http://127.0.0.1:5000/manager/personnel' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
I am using the following code to set up CORS:I also tried using CORS at the blueprint level unsuccessfully. What is most surprising is that some requests to the backend still succeed.
Someone had a similar issue on StackOverflow but never got a response: https://stackoverflow.com/questions/73665955/why-do-i-get-a-cors-error-with-react-axios-and-flask