[BlackBerry]Missing cookies from HTTP response header in Network tab of Web Inspector.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2012 02:32:50 +0000 (02:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2012 02:32:50 +0000 (02:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82041

We shouldn't overwrite cookies of response if there are more than one
header of Set-Cookie.

Patch by Jason Liu <jason.liu@torchmobile.com.cn> on 2012-03-28
Reviewed by Rob Buis.

Test: http/tests/cookies/resources/setArraycookies.php

* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::handleNotifyHeaderReceived):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112494 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/network/blackberry/NetworkJob.cpp

index 7044d0f..02a4493 100644 (file)
@@ -1,3 +1,18 @@
+2012-03-28  Jason Liu  <jason.liu@torchmobile.com.cn>
+
+        [BlackBerry]Missing cookies from HTTP response header in Network tab of Web Inspector.
+        https://bugs.webkit.org/show_bug.cgi?id=82041
+
+        We shouldn't overwrite cookies of response if there are more than one
+        header of Set-Cookie.
+
+        Reviewed by Rob Buis.
+
+        Test: http/tests/cookies/resources/setArraycookies.php
+
+        * platform/network/blackberry/NetworkJob.cpp:
+        (WebCore::NetworkJob::handleNotifyHeaderReceived):
+
 2012-03-28  Noel Gordon  <noel.gordon@gmail.com>
 
         JPEGImageDecoder: Set frame alpha state before marking a frame complete
index 4980de0..6a189ce 100644 (file)
@@ -306,6 +306,11 @@ void NetworkJob::handleNotifyHeaderReceived(const String& key, const String& val
         if (m_frame && m_frame->page() && m_frame->loader() && m_frame->loader()->client()
             && static_cast<FrameLoaderClientBlackBerry*>(m_frame->loader()->client())->cookiesEnabled())
             handleSetCookieHeader(value);
+
+        if (m_response.httpHeaderFields().contains("Set-Cookie")) {
+            m_response.setHTTPHeaderField(key, m_response.httpHeaderField(key) + "\r\n" + value);
+            return;
+        }
     }
 
     if (lowerKey == "www-authenticate")