Bug 46149
| Summary: | XMLHttpRequest: send(data) does not set Content-Type header correctly when data is DOMString or Document | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jian Li <jianli> |
| Component: | WebCore JavaScript | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Normal | CC: | ap, dimich, fishd, jianli, levin |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | PC | ||
| OS: | All | ||
Jian Li
XMLHttpRequest: send(data) does not set correct Content-Type header correctly when data is DOMString or Document.
Per the XHR spec:
If data is a Document
Let encoding be the preferred MIME name of the character encoding of data. If encoding is UTF-16 change it to UTF-8.
Let mime type be "application/xml" or "text/html" if Document is flagged as HTML document, followed by ";charset=", followed by encoding.
If data is a DOMString
Let encoding be UTF-8.
Let mime type be "text/plain;charset=UTF-8".
Test: http://tc.labs.opera.com/apis/XMLHttpRequest/send-content-type-string.htm
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
*** This bug has been marked as a duplicate of bug 11049 ***