Apologies if this seems like a silly question, but I'm trying to wrap my head around cross-domain requests and the new CORS specification.
A few years back, I used to encounter errors in the javascript console when attempting to make cross-origin requests via ajax that included the x-requesed-with
header, which would classify it as a non-simple request. Chrome would simply block the request due to the same-origin policy.
With the introduction of CORS, am I correct in assuming that instead of an error, Chrome will now trigger the preflight OPTIONS
request including the x-requested-with
header within the access-control-request-headers
? Will I no longer receive cross-origin errors unless the preflight fails to return an access-control-allow-origin
header?