What status code should a well-written HTTP server return when it gets a CORS preflight (OPTIONS
) request?
200
, 204
or somethi
I used 204
. Now it's not working cross-browser anymore. Use 200
. Firefox started rejecting CORS requests if 204
is received in the preflight. It wasted me almost 2 hours debugging it.
Lesson to learn: When in doubt about web standards don't choose what makes sense spec wise(i.e. 204
for no content)...choose what most people do(the easy/stupid choice)