crossdomain-requests-js icon indicating copy to clipboard operation
crossdomain-requests-js copied to clipboard

POST in Chrome does not work

Open DmitryEfimenko opened this issue 10 years ago • 0 comments

Not sure what's the deal, but as title suggests, POST request does not work in Google Chrome. Running exactly the same code in FireFox works fine.

Network tab of the Chrome Dev Tools shows OPTIONS call with status Failed. Console shows errors:

  • OPTIONS http://crossdomainserver.com/ Origin http://crossdomainclienta.com is not allowed by Access-Control-Allow-Origin.
  • XMLHttpRequest cannot load http://crossdomainserver.com/. Origin http://crossdomainclienta.com is not allowed by Access-Control-Allow-Origin.

On the server app I have a break point on Application_BeginRequest. On the Get method it gets hit every time. However, on the POST it never gets hit. I have an impression that Chrome "kills" request and it never reaches server app.

Just to make sure the headers are not the issue, all the following headers a slapped on any response from the server:

Response.AddHeader("Access-Control-Allow-Origin", "*");
Response.AddHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
Response.AddHeader("Access-Control-Allow-Credentials", "true");
Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control");
Response.AddHeader("Access-Control-Request-Method", "*");
Response.AddHeader("Access-Control-Request-Headers", "*");

Chrome Version 28.0.1500.71 m

Could you please confirm that it indeed behaves this way on Chrome?

DmitryEfimenko avatar Jul 15 '13 05:07 DmitryEfimenko