RESOLVED FIXED 111772
CFNetwork cache partitioning does not work properly on subdomains
https://bugs.webkit.org/show_bug.cgi?id=111772
Summary CFNetwork cache partitioning does not work properly on subdomains
Vicki Pfau
Reported 2013-03-07 13:51:16 PST
Currently, the CFNetwork cache partition is initialized on NSURLRequests with the wrong partition name--it uses the full domain instead of just the top privately-controlled domain. This causes the partitions to get out of sync and/or just not work properly.
Attachments
Patch (10.75 KB, patch)
2013-03-07 13:55 PST, Vicki Pfau
ddkilzer: review+
Vicki Pfau
Comment 1 2013-03-07 13:55:28 PST
David Kilzer (:ddkilzer)
Comment 2 2013-03-07 15:41:09 PST
Comment on attachment 192082 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=192082&action=review r=me > Source/WebCore/platform/network/mac/ResourceRequestMac.mm:193 > + String partition = cachePartition(); > + if (!partition.isNull() && !partition.isEmpty()) > + [NSURLProtocol setProperty:[NSString stringWithUTF8String:partition.utf8().data()] forKey:(NSString *)wkCachePartitionKey() inRequest:nsRequest]; This would be easier to read if you pulled out the UTF-8 string conversion as a separate local variable: NSString *partitionValue = [NSString stringWithUTF8String:partition.utf8().data()]; [NSURLProtocol setProperty:partitionValue forKey:(NSString *)wkCachePartitionKey() inRequest:nsRequest];
Vicki Pfau
Comment 3 2013-03-07 16:54:02 PST
Vicki Pfau
Comment 4 2013-03-07 17:13:49 PST
Darin Adler
Comment 5 2013-03-10 14:50:27 PDT
Comment on attachment 192082 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=192082&action=review >> Source/WebCore/platform/network/mac/ResourceRequestMac.mm:193 >> + [NSURLProtocol setProperty:[NSString stringWithUTF8String:partition.utf8().data()] forKey:(NSString *)wkCachePartitionKey() inRequest:nsRequest]; > > This would be easier to read if you pulled out the UTF-8 string conversion as a separate local variable: > > NSString *partitionValue = [NSString stringWithUTF8String:partition.utf8().data()]; > [NSURLProtocol setProperty:partitionValue forKey:(NSString *)wkCachePartitionKey() inRequest:nsRequest]; Why is UTF-8 involved at all? Why not just cachedPartition().nsString()?
Vicki Pfau
Comment 6 2013-03-11 11:59:59 PDT
(In reply to comment #5) > (From update of attachment 192082 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=192082&action=review > > >> Source/WebCore/platform/network/mac/ResourceRequestMac.mm:193 > >> + [NSURLProtocol setProperty:[NSString stringWithUTF8String:partition.utf8().data()] forKey:(NSString *)wkCachePartitionKey() inRequest:nsRequest]; > > > > This would be easier to read if you pulled out the UTF-8 string conversion as a separate local variable: > > > > NSString *partitionValue = [NSString stringWithUTF8String:partition.utf8().data()]; > > [NSURLProtocol setProperty:partitionValue forKey:(NSString *)wkCachePartitionKey() inRequest:nsRequest]; > > Why is UTF-8 involved at all? Why not just cachedPartition().nsString()? It's an unfortunate workaround for <rdar://problem/13361941>, which CFNetwork has said they're not going to fix.
Note You need to log in before you can comment on or make changes to this bug.