Bug 108148
Summary: | Wrong default Content-Type set in XMLHttpRequest.send(String) | ||
---|---|---|---|
Product: | WebKit | Reporter: | Victor Costan <costan> |
Component: | XML | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | ||
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All |
Victor Costan
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.27 (KHTML, like Gecko) Chrome/26.0.1386.0 Safari/537.27
Steps to reproduce the problem:
1. Run the following JavaScript
xhr = new XMLHttpRequest
xhr.open('POST', window.location.href, false);
xhr.send('Hello world!')
2. Open the developer tools and check the Content-Type of the request.
What is the expected behavior?
The Content-Type should be "text/plain;charset=UTF-8".
See step 4, subsection "string" in http://www.w3.org/TR/XMLHttpRequest/#the-send()-method
What went wrong?
Chrome seems to use "application/xml" as the default Content-Type when the XMLHttpRequest#send() argument is a String.
Did this work before? No
Chrome version: 26.0.1386.0 Channel: dev
OS Version: Fedora x84_64
Firefox sends the "text/plain; charset=UTF-8" Content-Type, which is almost correct.
I am working on a WebKit patch for this issue. I have the code patch, and I'm currently working on a layout test and figuring out the contribution guide.
This bug appears to address a subset of 11049, but the patch attached there does not seem to cover the case that my patch addresses.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Victor Costan
This bug is also posted in the Chromium tracker: http://crbug.com/172802
Alexey Proskuryakov
*** This bug has been marked as a duplicate of bug 99973 ***