Bug 46149 - XMLHttpRequest: send(data) does not set Content-Type header correctly when data is DOMString or Document
Summary: XMLHttpRequest: send(data) does not set Content-Type header correctly when da...
Status: RESOLVED DUPLICATE of bug 11049
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-20 17:54 PDT by Jian Li
Modified: 2010-09-20 18:31 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jian Li 2010-09-20 17:54:59 PDT
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
Comment 1 Alexey Proskuryakov 2010-09-20 18:31:12 PDT

*** This bug has been marked as a duplicate of bug 11049 ***