Title: [153946] trunk/Source/WebCore
Revision
153946
Author
[email protected]
Date
2013-08-12 09:52:48 -0700 (Mon, 12 Aug 2013)

Log Message

[Curl] Cookie is not set when url string is unicode.
https://bugs.webkit.org/show_bug.cgi?id=119545

Patch by [email protected] <[email protected]> on 2013-08-12
Reviewed by Brent Fulgham.

When the method setCookiesFromDOM is called with an unicode url parameter, the cookie is not correctly set.
We need to convert the cookie string to 8 bit, before passing it to the Curl api function.

* platform/network/curl/CookieJarCurl.cpp:
(WebCore::setCookiesFromDOM): Convert cookie string to 8 bit, if needed.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (153945 => 153946)


--- trunk/Source/WebCore/ChangeLog	2013-08-12 16:49:56 UTC (rev 153945)
+++ trunk/Source/WebCore/ChangeLog	2013-08-12 16:52:48 UTC (rev 153946)
@@ -1,3 +1,16 @@
+2013-08-12  [email protected]  <[email protected]>
+
+        [Curl] Cookie is not set when url string is unicode.
+        https://bugs.webkit.org/show_bug.cgi?id=119545
+
+        Reviewed by Brent Fulgham.
+
+        When the method setCookiesFromDOM is called with an unicode url parameter, the cookie is not correctly set.
+        We need to convert the cookie string to 8 bit, before passing it to the Curl api function.
+
+        * platform/network/curl/CookieJarCurl.cpp:
+        (WebCore::setCookiesFromDOM): Convert cookie string to 8 bit, if needed.
+
 2013-08-12  Eric Carlson  <[email protected]>
 
         Revert r153912 because it broke some track tests.

Modified: trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp (153945 => 153946)


--- trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp	2013-08-12 16:49:56 UTC (rev 153945)
+++ trunk/Source/WebCore/platform/network/curl/CookieJarCurl.cpp	2013-08-12 16:52:48 UTC (rev 153946)
@@ -238,6 +238,9 @@
     // required behavior if the domain field is not explicity specified.
     String cookie = getNetscapeCookieFormat(url, value);
 
+    if (!cookie.is8Bit())
+        cookie = String::make8BitFrom16BitSource(cookie.characters16(), cookie.length());
+
     CString strCookie(reinterpret_cast<const char*>(cookie.characters8()), cookie.length());
 
     curl_easy_setopt(curl, CURLOPT_COOKIELIST, strCookie.data());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to