metajack / strophejs

The Strophe.js repository has moved to https://github.com/strophe/strophejs
http://strophe.im/strophejs
MIT License
810 stars 160 forks source link

Chrome and safari CORS fix #111

Open sawantuday opened 11 years ago

sawantuday commented 11 years ago

This is a chrome CORS fix, Chrome changes the request method from POST to OPTIONS thus not carriying the initial xml stanza. this keeps the http request pending for random time period before restarting it. Setting content type of the request to text/plain avoids this problem

metajack commented 11 years ago

I'm not sure this fix makes sense.

Chrome is not changing a POST into an OPTIONS. It's making a preflight request with OPTIONS to determine CORS support. See http://www.w3.org/TR/cors/#cross-origin-request-with-preflight-0 for details.

I'm not aware of a bug in Chrome regarding this, and I used Chrome with Strophe.js quite heavily for several years.

Am I misunderstanding the problem? It's possible there is a bug, but I'm having trouble understanding what it is from your description.