Closed DisaPadla closed 6 years ago
The preflight/CORS is handled by the browser, not by axios or this middleware.
You need to make sure your server allows for CORS requests.
@nmaves but if i use just axios, like:
axios.post('https://another_url', data, {
'Access-Control-Allow-Origin': '*',
Accept: 'application/json',
})
all works fine
Those are not valid configuration options per https://github.com/axios/axios#request-config. Honestly, those are headers that the server should set. I would remove them altogether.
I set "Access-Control-Allow-Origin: *", but always get a warning: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.