When doing CORS requests that require preflight, they fail to work on our network. Instead of Chrome making two requests, the OPTIONS and PUT, it fires two OPTIONS requests that are exactly the same, this ends up in the following error:
XMLHttpRequest cannot load http://server/api/foo. Response for preflight is invalid (redirect)
Digging into the problem, there are two things that stand out.
If I turn on Throttling in the Network section of the Chrome developer tools, things work and the OPTIONS request is followed by a PUT.
Under the timing tab, it almost looks like as if it tries to fire both (First request,
Second request) requests simultaneously. Despite the fact that a request is queued at a later time, the Started At time shows it at the same request as the initial OPTIONS request.
The throttled working, and non-working requests look fairly similar for comparison.
Chrome firing two OPTIONS requests on CORS preflight