Axios redirect 308 not working (CORS error)

Viewed 210

We are implementing short URLs to redirect on our project.

I do an API request to my server using axios, with the info on the short url. The server responds with a redirect status 308 succesffuly.

I see in the response headers, the location parameter (to redirect to) is correct. And we have also set Access-Control-Allow-Origin: *

But the redirect does not follow through...

After recieving the 308; the browser attempts a preflight OPTIONS request to the redirect URL, followed by a GET request to the redirect URL. Both of these return an error. The preflight request error: CORS Misssing Allow Origin. And the GET request gives error: NS_ERROR_DOM_BAD_URI


Not sure what the issue is. Is it on the front-end, or on the server-side? Any advice would be greatly appreciated!

0 Answers
Related