RESOLVED DUPLICATE of bug 99973 137865
XMLHttpRequest using wrong default content-type, forcing CORS preflight
https://bugs.webkit.org/show_bug.cgi?id=137865
Summary XMLHttpRequest using wrong default content-type, forcing CORS preflight
Chris J. Shull
Reported 2014-10-19 12:19:25 PDT
Per http://www.w3.org/TR/XMLHttpRequest2/#the-send-method When sending a string: Let mime type be "text/plain;charset=UTF-8". Now try this with an HTTP proxy/monitor and Safari 8.0: var xhr = new XMLHttpRequest(); var url = "http://www.corsproxy.com/en.wikipedia.org/wiki/Http?" + Date.now(); xhr.open("POST", url, true); xhr.send("test"); Observed: An OPTIONS preflight. Because the Content-Type in the POST request has been set to application/xml. Expected: No OPTIONS preflight. Content-Type in the POST request to be text/plain;charset=UTF-8.
Attachments
Chris J. Shull
Comment 1 2014-10-19 12:23:54 PDT
For note, Chrome v38 handles this correctly, as does Forefox v33.
Alexey Proskuryakov
Comment 2 2014-10-20 20:59:11 PDT
I think that "text/plain;charset=UTF-8" would also cause preflight, as the implementation stands now. *** This bug has been marked as a duplicate of bug 99973 ***
youenn fablet
Comment 3 2014-10-21 01:35:11 PDT
(In reply to comment #2) > I think that "text/plain;charset=UTF-8" would also cause preflight, as the > implementation stands now. The request should already be considered as simple by the latest webkit revision. I will double check this and report.
Alexey Proskuryakov
Comment 4 2014-10-21 09:50:28 PDT
Yes, looks like I was wrong, it doesn't cause a preflight any more.
Note You need to log in before you can comment on or make changes to this bug.