Title: [213226] trunk/Source/WebCore
Revision
213226
Author
[email protected]
Date
2017-03-01 09:36:17 -0800 (Wed, 01 Mar 2017)

Log Message

REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
https://bugs.webkit.org/show_bug.cgi?id=169024

Reviewed by Youenn Fablet.

This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.

Fixes: http/tests/download/literal-utf-8.html

* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::platformSuggestedFilename):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (213225 => 213226)


--- trunk/Source/WebCore/ChangeLog	2017-03-01 17:23:37 UTC (rev 213225)
+++ trunk/Source/WebCore/ChangeLog	2017-03-01 17:36:17 UTC (rev 213226)
@@ -1,5 +1,22 @@
 2017-03-01  Carlos Garcia Campos  <[email protected]>
 
+        REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
+        https://bugs.webkit.org/show_bug.cgi?id=169024
+
+        Reviewed by Youenn Fablet.
+
+        This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
+        conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
+        fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
+        the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
+
+        Fixes: http/tests/download/literal-utf-8.html
+
+        * platform/network/soup/ResourceResponseSoup.cpp:
+        (WebCore::ResourceResponse::platformSuggestedFilename):
+
+2017-03-01  Carlos Garcia Campos  <[email protected]>
+
         [GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
         https://bugs.webkit.org/show_bug.cgi?id=169019
 

Modified: trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp (213225 => 213226)


--- trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp	2017-03-01 17:23:37 UTC (rev 213225)
+++ trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp	2017-03-01 17:36:17 UTC (rev 213226)
@@ -98,6 +98,8 @@
 {
     SoupMessageHeaders* soupHeaders = soup_message_headers_new(SOUP_MESSAGE_HEADERS_RESPONSE);
     String contentDisposition(httpHeaderField(HTTPHeaderName::ContentDisposition));
+    if (contentDisposition.is8Bit())
+        contentDisposition = String::fromUTF8WithLatin1Fallback(contentDisposition.characters8(), contentDisposition.length());
     soup_message_headers_append(soupHeaders, "Content-Disposition", contentDisposition.utf8().data());
     GRefPtr<GHashTable> params;
     soup_message_headers_get_content_disposition(soupHeaders, nullptr, &params.outPtr());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to