react-axios fails Preflight CORS, while axios in react passes
dryprogrammer opened this issue · comments
react-axios fails CORS despite access-control-allow-origin: *
on the server, while running axios in react passes.
Here are the http headers:
curl -v https://jsonplaceholder.typicode.com/users
> GET /users HTTP/2
> Host: jsonplaceholder.typicode.com
> user-agent: curl/7.68.0
> accept: */*
< content-type: application/json; charset=utf-8
< x-powered-by: Express
< x-ratelimit-limit: 1000
< x-ratelimit-remaining: 998
< x-ratelimit-reset: 1645868764
< vary: Origin, Accept-Encoding
< access-control-allow-credentials: true
< cache-control: max-age=43200
< pragma: no-cache
< expires: -1
< x-content-type-options: nosniff
curl -v https://bible-api.com/john%203:16
> GET /john%203:16 HTTP/2
> Host: bible-api.com
> user-agent: curl/7.68.0
> accept: */*
< HTTP/2 200
< server: nginx
< date: Fri, 03 Jun 2022 16:07:43 GMT
< content-type: application/json;charset=utf-8
< content-length: 493
< access-control-allow-origin: *
< access-control-allow-methods: OPTIONS
< x-content-type-options: nosniff
Found the culprit after many many days... why... 😭
v2.0.5...master
sheaivey Do you think you can push a quick fix?
Can you create a pull request of what you think the quick fix is? I’ll try and review the pr tomorrow and get some other version bumps in while I’m at it.
Oh! I thought that fix was in the latest release from a year ago. I’ll get it pushed out today. Thanks for clarifying.
Ok, release v2.0.6 is out now and ready for use.