Changeset 28515 in webkit


Ignore:
Timestamp:
Dec 7, 2007 2:17:08 AM (16 years ago)
Author:
ap@webkit.org
Message:

Reviewed by Darin.

http://bugs.webkit.org/show_bug.cgi?id=16325
<rdar://problem/5632997> REGRESSION: www.xerox.ru doesn't work


Test: http/tests/misc/empty-cookie.html

  • platform/mac/CookieJar.mm: (WebCore::setCookies): Don't store empty cookies. (WebCore::cookies): Filter out empty cookies if we have them, as they could have been set with an earlier version of Leopard!
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r28513 r28515  
     12007-12-07  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=16325
     6        <rdar://problem/5632997> REGRESSION: www.xerox.ru doesn't work
     7
     8        * http/tests/misc/empty-cookie-expected.txt: Added.
     9        * http/tests/misc/empty-cookie.html: Added.
     10
    1112007-12-06  Alexey Proskuryakov  <ap@webkit.org>
    212
  • trunk/WebCore/ChangeLog

    r28514 r28515  
     12007-12-07  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by Darin.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=16325
     6        <rdar://problem/5632997> REGRESSION: www.xerox.ru doesn't work
     7       
     8        Test: http/tests/misc/empty-cookie.html
     9
     10        * platform/mac/CookieJar.mm:
     11        (WebCore::setCookies): Don't store empty cookies.
     12        (WebCore::cookies): Filter out empty cookies if we have them, as they could have been set
     13        with an earlier version of Leopard!
     14
    1152007-12-06  Ada Chan  <adachan@apple.com>
    216
  • trunk/WebCore/platform/mac/CookieJar.mm

    r17652 r28515  
    3131#import "PlatformString.h"
    3232
     33#import <wtf/RetainPtr.h>
     34
     35#ifdef BUILDING_ON_TIGER
     36typedef unsigned int NSUInteger;
     37#endif
     38
    3339namespace WebCore {
    3440
     
    3945    NSURL *URL = url.getNSURL();
    4046    NSArray *cookiesForURL = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:URL];
    41     NSDictionary *header = [NSHTTPCookie requestHeaderFieldsWithCookies:cookiesForURL];
     47
     48    // <rdar://problem/5632883> On 10.5, NSHTTPCookieStorage would happily store an empty cookie, which would be sent as "Cookie: =".
     49    // We have a workaround in setCookies() to prevent that, but we also need to avoid sending cookies that were previously stored.
     50    NSUInteger count = [cookiesForURL count];
     51    RetainPtr<NSMutableArray> cookiesForURLFilteredCopy(AdoptNS, [[NSMutableArray alloc] initWithCapacity:count]);
     52    for (NSUInteger i = 0; i < count; ++i) {
     53        NSHTTPCookie *cookie = (NSHTTPCookie *)[cookiesForURL objectAtIndex:i];
     54        if ([[cookie name] length] != 0)
     55            [cookiesForURLFilteredCopy.get() addObject:cookie];
     56    }
     57
     58    NSDictionary *header = [NSHTTPCookie requestHeaderFieldsWithCookies:cookiesForURLFilteredCopy.get()];
    4259    return [header objectForKey:@"Cookie"];
    4360
     
    4966{
    5067    BEGIN_BLOCK_OBJC_EXCEPTIONS;
     68
     69    // <rdar://problem/5632883> On 10.5, NSHTTPCookieStorage would happily store an empty cookie, which would be sent as "Cookie: =".
     70    if (cookieStr.isEmpty())
     71        return;
    5172
    5273    NSURL *URL = url.getNSURL();
Note: See TracChangeset for help on using the changeset viewer.