Safari turns Simple Cors request into preflight after 302 redirect

I found out that the following problem occurs on safari through Javascript, jQuery Ajax:

  • I am making a simple cors request using GET
  • Server responses with 302
  • Safari follows the redirect, but uses the OPTIONS method instead of the GET method, so it performs a request preview

I would expect step 3 to also trigger a simple request using GET, which is exactly the same in Chrome and Firefox.

The problem is that the server that responds to the request after step 3 cannot process requests using the OPTIONS methods and therefore fails with the status of "Method Not Allowed". Since I do not affect the server side, I need to force or not to perform automatic redirection, but to do it manually or somehow say safari so as not to switch to OPTIONS.

Is there a way to make one of these options?

+4
source share

All Articles