Correct the default Content-Type for XHR Post with string data as per XHR specification.
As per the W3C XMLHttpRequest specification (http://www.w3.org/TR/XMLHttpRequest/#the-send%28%29-method)
the default data type for string data is "text/plain;charset=UTF-8" when content-type
is not set by the author. However "application/xml" was set as the default type.
This resulted in preflight requests being made for string data
when the content-type is not set explicitly using setRequestHeader() since "application/xml"
is not in mime-type whitelist (http://www.w3.org/TR/cors/#simple-header).
Updated the content-type as per XHR specification.
Added layout test to verify no preflight test is made when data is string in XHR POST.
Added layout test to verify "text/plain;charset=UTF-8" is set as content-type
for XHR POST with string data.
Updated the test expecations of the impacted tests.
BUG=71694R=abarth@chromium.org, cevans@chromium.org, bbudge@chromium.org
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155717
Issue 22601002: Correct the default Content-Type for XHR Post with string data as per XHR specification.
(Closed)
Created 7 years, 4 months ago by ancilgeorge
Modified 7 years, 4 months ago
Reviewers: abarth-chromium, bbudge, Chris Evans
Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Comments: 0