Disk cache should support Vary: Cookie
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Mar 2015 16:09:06 +0000 (16:09 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Mar 2015 16:09:06 +0000 (16:09 +0000)
commita71d47fcc651b9d834400da4e43d61fb7998cc86
treebf2157edd42ce233ba973416dedeabba7a5df6d4
parentaad80bafaa72f6f75064b1340b07e3680cec723a
Disk cache should support Vary: Cookie
https://bugs.webkit.org/show_bug.cgi?id=142770
Source/WebKit2:

rdar://problem/19764945

Reviewed by Anders Carlsson.

Cookies are not part of the original request but are added by the networking layer when submitting the request.
Fetch them explicitly when resolving Vary: Cookie.

The implementation is not perfect as it fetches the cookie for the cache entry when saving a Vary:Cookie response,
not when making the request. In principle the cookie may have changed in-between. This should be enough to handle
reasonable cases though. Fetching cookies for every request might be too expensive for this rarely used feature.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::headerValueForVary):
(WebKit::NetworkCache::encodeStorageEntry):
(WebKit::NetworkCache::verifyVaryingRequestHeaders):

LayoutTests:

Reviewed by Anders Carlsson.

* http/tests/cache/disk-cache-vary-cookie-expected.txt: Added.
* http/tests/cache/disk-cache-vary-cookie.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181651 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/cache/disk-cache-vary-cookie-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache-vary-cookie.html [new file with mode: 0644]
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp