Changeset 181651 in webkit
- Timestamp:
- Mar 17, 2015 9:09:06 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181618 r181651 1 2015-03-17 Antti Koivisto <antti@apple.com> 2 3 Disk cache should support Vary: Cookie 4 https://bugs.webkit.org/show_bug.cgi?id=142770 5 6 Reviewed by Anders Carlsson. 7 8 * http/tests/cache/disk-cache-vary-cookie-expected.txt: Added. 9 * http/tests/cache/disk-cache-vary-cookie.html: Added. 10 1 11 2015-03-16 Ryosuke Niwa <rniwa@webkit.org> 2 12 -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r180771 r181651 95 95 http/tests/cache/disk-cache-validation.html 96 96 http/tests/cache/disk-cache-disable.html 97 http/tests/cache/disk-cache-vary-cookie.html 97 98 98 99 ### END OF (2) Failures without bug reports -
trunk/LayoutTests/platform/win/TestExpectations
r181602 r181651 2223 2223 http/tests/cache/disk-cache-validation.html 2224 2224 http/tests/cache/disk-cache-disable.html 2225 http/tests/cache/disk-cache-vary-cookie.html 2225 2226 2226 2227 # The following are unreviewed: -
trunk/Source/WebKit2/ChangeLog
r181630 r181651 1 2015-03-17 Antti Koivisto <antti@apple.com> 2 3 Disk cache should support Vary: Cookie 4 https://bugs.webkit.org/show_bug.cgi?id=142770 5 rdar://problem/19764945 6 7 Reviewed by Anders Carlsson. 8 9 Cookies are not part of the original request but are added by the networking layer when submitting the request. 10 Fetch them explicitly when resolving Vary: Cookie. 11 12 The implementation is not perfect as it fetches the cookie for the cache entry when saving a Vary:Cookie response, 13 not when making the request. In principle the cookie may have changed in-between. This should be enough to handle 14 reasonable cases though. Fetching cookies for every request might be too expensive for this rarely used feature. 15 16 * NetworkProcess/cache/NetworkCache.cpp: 17 (WebKit::NetworkCache::headerValueForVary): 18 (WebKit::NetworkCache::encodeStorageEntry): 19 (WebKit::NetworkCache::verifyVaryingRequestHeaders): 20 1 21 2015-03-17 Zan Dobersek <zdobersek@igalia.com> 2 22 -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
r181364 r181651 39 39 #include <WebCore/FileSystem.h> 40 40 #include <WebCore/HTTPHeaderNames.h> 41 #include <WebCore/NetworkStorageSession.h> 42 #include <WebCore/PlatformCookieJar.h> 41 43 #include <WebCore/ResourceResponse.h> 42 44 #include <WebCore/SharedBuffer.h> … … 98 100 } 99 101 102 static String headerValueForVary(const WebCore::ResourceRequest& request, const String& headerName) 103 { 104 // Explicit handling for cookies is needed because they are added magically by the networking layer. 105 // FIXME: The value might have changed between making the request and retrieving the cookie here. 106 // We could fetch the cookie when making the request but that seems overkill as the case is very rare and it 107 // is a blocking operation. This should be sufficient to cover reasonable cases. 108 if (headerName == httpHeaderNameString(WebCore::HTTPHeaderName::Cookie)) 109 return WebCore::cookieRequestHeaderFieldValue(WebCore::NetworkStorageSession::defaultStorageSession(), request.firstPartyForCookies(), request.url()); 110 return request.httpHeaderField(headerName); 111 } 112 100 113 static Storage::Entry encodeStorageEntry(const WebCore::ResourceRequest& request, const WebCore::ResourceResponse& response, PassRefPtr<WebCore::SharedBuffer> responseData) 101 114 { … … 115 128 for (auto& varyHeaderName : varyingHeaderNames) { 116 129 String headerName = varyHeaderName.stripWhiteSpace(); 117 varyingRequestHeaders.append(std::make_pair(headerName, request.httpHeaderField(headerName))); 130 String headerValue = headerValueForVary(request, headerName); 131 varyingRequestHeaders.append(std::make_pair(headerName, headerValue)); 118 132 } 119 133 encoder << varyingRequestHeaders; … … 136 150 if (varyingRequestHeader.first == "*") 137 151 return false; 138 String requestValue = request.httpHeaderField(varyingRequestHeader.first);139 if ( requestValue != varyingRequestHeader.second)152 String headerValue = headerValueForVary(request, varyingRequestHeader.first); 153 if (headerValue != varyingRequestHeader.second) 140 154 return false; 141 155 }
Note: See TracChangeset
for help on using the changeset viewer.