Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

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
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

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=71694 R=abarth@chromium.org, cevans@chromium.org, bbudge@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=155717

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -113 lines) Patch
M LayoutTests/http/tests/security/mixedContent/insecure-sync-post-xhr-allowed-expected.txt View 1 chunk +0 lines, -2 lines 0 comments Download
A + LayoutTests/http/tests/xmlhttprequest/access-control-basic-post-success-no-content-type.html View 2 chunks +6 lines, -6 lines 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/access-control-basic-post-success-no-content-type-expected.txt View 1 chunk +5 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/methods-async-expected.txt View 1 chunk +10 lines, -10 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/methods-expected.txt View 1 chunk +10 lines, -10 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/methods-lower-case-expected.txt View 1 chunk +4 lines, -4 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/post-content-type-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/request-encoding2-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/resources/access-control-basic-post-success-no-content-type.php View 1 chunk +11 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/resources/xmlhttprequest-no-content-type-with-text.php View 1 chunk +11 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/workers/methods-async-expected.txt View 1 chunk +10 lines, -10 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/workers/methods-expected.txt View 1 chunk +10 lines, -10 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/workers/shared-worker-methods-async-expected.txt View 1 chunk +10 lines, -10 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/workers/shared-worker-methods-expected.txt View 1 chunk +10 lines, -10 lines 0 comments Download
A + LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-no-content-type-with-text.html View 2 chunks +5 lines, -6 lines 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-no-content-type-with-text-expected.txt View 1 chunk +5 lines, -0 lines 0 comments Download
M LayoutTests/platform/linux/http/tests/xmlhttprequest/methods-expected.txt View 1 chunk +10 lines, -10 lines 0 comments Download
M LayoutTests/platform/linux/http/tests/xmlhttprequest/workers/methods-async-expected.txt View 1 chunk +10 lines, -10 lines 0 comments Download
M LayoutTests/platform/win/http/tests/xmlhttprequest/methods-expected.txt View 1 chunk +6 lines, -6 lines 0 comments Download
M LayoutTests/platform/win/http/tests/xmlhttprequest/workers/methods-async-expected.txt View 1 chunk +6 lines, -6 lines 0 comments Download
M Source/core/xml/XMLHttpRequest.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
ancilgeorge
Requesting review. Details on the modified test expectations: http/tests/security/mixedContent/insecure-sync-post-xhr-allowed.html: https://src.chromium.org/viewvc/blink?view=revision&revision=150373 - Consider "mixed content XHR" ...
7 years, 4 months ago (2013-08-07 16:36:50 UTC) #1
abarth-chromium
How does this new behavior compare to other browsers?
7 years, 4 months ago (2013-08-07 18:14:52 UTC) #2
ancilgeorge
On 2013/08/07 18:14:52, abarth wrote: > How does this new behavior compare to other browsers? ...
7 years, 4 months ago (2013-08-07 19:26:47 UTC) #3
abarth-chromium
lgtm Great!
7 years, 4 months ago (2013-08-07 19:33:01 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ancilgeorge@samsung.com/22601002/1
7 years, 4 months ago (2013-08-07 19:33:09 UTC) #5
commit-bot: I haz the power
7 years, 4 months ago (2013-08-07 21:31:22 UTC) #6
Message was sent while issue was closed.
Change committed as 155717

Powered by Google App Engine
This is Rietveld 408576698