Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r176930 - [Soup][Curl] HTTP header values should be treated as …
…latin1, not UTF-8 https://bugs.webkit.org/show_bug.cgi?id=128739 Patch by Youenn Fablet <youenn.fablet@crf.canon.fr> on 2014-12-07 Reviewed by Martin Robinson. Source/WebCore: Removed UTF-8 conversion of HTTP header values (SOUP and CURL). Removed unnecessary UTF-8 conversion of HTTP header names (SOUP). Changed conversion of HTTP method from UTF-8 to ASCII (SOUP and CURL). Added explicit UTF-8 conversion of Content-Disposition header to compute download suggested filename. Test: http/tests/xmlhttprequest/response-special-characters.html * platform/network/curl/CurlDownload.cpp: (WebCore::CurlDownload::headerCallback): Removed header conversion. * platform/network/curl/ResourceHandleManager.cpp: (WebCore::headerCallback): Ditto. (WebCore::ResourceHandleManager::initializeHandle): Changed HTTP method conversion to ASCI. * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateFromSoupMessageHeaders): Removed header conversion. (WebCore::ResourceRequest::updateSoupMessage): Changed HTTP method conversion to ASCII. (WebCore::ResourceRequest::toSoupMessage): Ditto. (WebCore::ResourceRequest::updateFromSoupMessage): * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::updateFromSoupMessageHeaders): Rmoved header conversion. (WebCore::ResourceResponse::platformSuggestedFilename): Added explicit conversion of contentDisposition to UTF-8. LayoutTests: Tests that non ascii header & reason phrase values are correctly retrieved by the web application. headers.php script sends a response that includes non ascii header value. not-ascii-status.php sends a response that includes non ascii reason phrase. Removed specific gtk/efl expectations as now aligned with regular expectation. * http/tests/xmlhttprequest/resources/headers.php: Added. * http/tests/xmlhttprequest/resources/not-ascii-status.php: Added. * http/tests/xmlhttprequest/response-special-characters-expected.txt: Added. * http/tests/xmlhttprequest/response-special-characters.html: Added. * platform/efl/http/tests/security/contentSecurityPolicy/source-list-parsing-nonascii-expected.txt: Removed. * platform/gtk/http/tests/security/contentSecurityPolicy/source-list-parsing-nonascii-expected.txt: Removed. Canonical link: https://commits.webkit.org/154760.259@webkitgtk/2.6 git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@178328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
e164e28
commit 72293af
Showing
12 changed files
with
128 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
LayoutTests/http/tests/xmlhttprequest/resources/headers.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
header("Content-Type: text/plain"); | ||
header("X-Custom-Header: test"); | ||
header("Set-Cookie: test"); | ||
header("Set-Cookie2: test"); | ||
header("X-Custom-Header-Empty:"); | ||
header("X-Custom-Header-Comma: 1"); | ||
header("X-Custom-Header-Comma: 2", false); | ||
header("X-Custom-Header-Bytes: …"); | ||
echo "TEST"; | ||
?> |
4 changes: 4 additions & 0 deletions
4
LayoutTests/http/tests/xmlhttprequest/resources/not-ascii-status.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
header('HTTP/1.1 200 OK…'); | ||
echo "OK…"; | ||
?> |
4 changes: 4 additions & 0 deletions
4
LayoutTests/http/tests/xmlhttprequest/response-special-characters-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
PASS non ascii response header value | ||
PASS non ascii statusText | ||
|
52 changes: 52 additions & 0 deletions
52
LayoutTests/http/tests/xmlhttprequest/response-special-characters.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>XMLHttpRequest: getting response with funny characters</title> | ||
<script src="/js-test-resources/testharness.js"></script> | ||
<script src="/js-test-resources/testharnessreport.js"></script> | ||
<!-- test file originating from W3C web platform test suite --> | ||
</head> | ||
<body> | ||
<div id="log"></div> | ||
<script> | ||
function run_test(name, setupFunction, assertFunction) | ||
{ | ||
var test = async_test(name) | ||
test.isAsserted = false | ||
test.step(function() { | ||
var client = new XMLHttpRequest() | ||
client.onreadystatechange = function() { | ||
test.step(function() { | ||
if(client.readyState == 4) { | ||
test.isAsserted = true | ||
assertFunction(client) | ||
} | ||
}) | ||
} | ||
client.onloadend = function() { | ||
assert_true(test.isAsserted) | ||
test.done() | ||
} | ||
setupFunction(client) | ||
client.send(null) | ||
}) | ||
} | ||
|
||
run_test("non ascii response header value", | ||
function(client){ | ||
client.open("GET", "resources/headers.php") | ||
},function(client){ | ||
assert_equals(client.getResponseHeader("x-custom-header-bytes"), "\xE2\x80\xA6") | ||
} | ||
) | ||
|
||
run_test("non ascii statusText", | ||
function(client){ | ||
client.open("GET", "resources/not-ascii-status.php") | ||
},function(client){ | ||
assert_equals(client.statusText, "OK\xE2\x80\xA6") | ||
} | ||
) | ||
</script> | ||
</body> | ||
</html> |
9 changes: 0 additions & 9 deletions
9
...m/efl/http/tests/security/contentSecurityPolicy/source-list-parsing-nonascii-expected.txt
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...m/gtk/http/tests/security/contentSecurityPolicy/source-list-parsing-nonascii-expected.txt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters