I’m making a cross domain POST request. I added Access-Control-* headers to the web server, but Google Chrome javascript console raises:
XMLHttpRequest cannot load http://api.sharee.dev:3000/assets.json. Origin http://sharee.dev:4000 is not allowed by Access-Control-Allow-Origin.
POST http://api.sharee.dev:3000/assets.json undefined (undefined)
Here are all the packets that are transferred during the request: http://pastie.org/1882455
As you can see it stills sends the POST request after OPTIONS request. It doesn’t work in Firefox either. Firefox shows that POST request was sent to the server and the response code was 200, but the response itself is empty.
The Access-Control-Allow-Origin and Access-Control-Allow-Credentials headers should be a part of any CORS response (including the preflight OPTIONS request and the POST request). Your current example shows them only on the OPTIONS response.