Changeset 112080 in webkit


Ignore:
Timestamp:
Mar 26, 2012 5:42:44 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Cookies mismatch when login to gmail.
https://bugs.webkit.org/show_bug.cgi?id=82165

Redirection's response can add or update cookies. The cookies of ResourceRequest is dirty
in this case. We shouldn't copy the dirty cookie header from ResourceRequest to PlatformRequest
for redirection loading.

This issue didn't happen before because we used m_cookieData not the cookie header.
Now we use the cookie header to avoid storing double cookie's data, and m_cookieData is removed.

Patch by Jason Liu <jason.liu@torchmobile.com.cn> on 2012-03-26
Reviewed by George Staikos.

No new tests. It is a refactoring issue.

  • platform/network/blackberry/ResourceRequestBlackBerry.cpp:

(WebCore::ResourceRequest::initializePlatformRequest):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112078 r112080  
     12012-03-26  Jason Liu  <jason.liu@torchmobile.com.cn>
     2
     3        [BlackBerry] Cookies mismatch when login to gmail.
     4        https://bugs.webkit.org/show_bug.cgi?id=82165
     5
     6        Redirection's response can add or update cookies. The cookies of ResourceRequest is dirty
     7        in this case. We shouldn't copy the dirty cookie header from ResourceRequest to PlatformRequest
     8        for redirection loading.
     9
     10        This issue didn't happen before because we used m_cookieData not the cookie header.
     11        Now we use the cookie header to avoid storing double cookie's data, and m_cookieData is removed.
     12
     13        Reviewed by George Staikos.
     14
     15        No new tests. It is a refactoring issue.
     16
     17        * platform/network/blackberry/ResourceRequestBlackBerry.cpp:
     18        (WebCore::ResourceRequest::initializePlatformRequest):
     19
    1202012-03-26  Alexis Menard  <alexis.menard@openbossa.org>
    221
  • trunk/Source/WebCore/platform/network/blackberry/ResourceRequestBlackBerry.cpp

    r111809 r112080  
    155155            if (!key.isEmpty() && !value.isEmpty()) {
    156156                // We need to check the encoding and encode the cookie's value using latin1 or utf8 to support unicode characters.
    157                 if (equalIgnoringCase(key, "Cookie"))
     157                // We wo't use the old cookies of resourceRequest for new location because these cookies may be changed by redirection.
     158                if (!equalIgnoringCase(key, "Cookie"))
     159                    platformRequest.addHeader(key.latin1().data(), value.latin1().data());
     160                else if (!isRedirect)
    158161                    platformRequest.addHeader(key.latin1().data(), value.containsOnlyLatin1() ? value.latin1().data() : value.utf8().data());
    159                 else
    160                     platformRequest.addHeader(key.latin1().data(), value.latin1().data());
    161162            }
    162163        }
    163164       
    164         // Redirection's response may contain new cookies, so add cookies again.
     165        // Redirection's response may add or update cookies, so we get cookies from CookieManager when redirection happens.
    165166        // If there aren't cookies in the header list, we need trying to add cookies.
    166167        if (cookiesEnabled && (isRedirect || !httpHeaderFields().contains("Cookie")) && !url().isNull()) {
Note: See TracChangeset for help on using the changeset viewer.