Verify Prefetch and credential behavior
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Aug 2019 20:26:54 +0000 (20:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Aug 2019 20:26:54 +0000 (20:26 +0000)
commit4e6d7256d512e918f1357b7876a15742238c7172
tree23de4577c566a6a525870340b25cab166c0b3fd6
parentdb9f0b1f1bca3700af0275ce8d4fdf148f90e28d
Verify Prefetch and credential behavior
https://bugs.webkit.org/show_bug.cgi?id=200000

Patch by Rob Buis <rbuis@igalia.com> on 2019-08-21
Reviewed by Youenn Fablet.

Source/WebKit:

Cancel cross-origin prefetches for Vary: Cookie.

Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::didReceiveResponse):
* NetworkProcess/cache/PrefetchCache.cpp:
(WebKit::PrefetchCache::take):

LayoutTests:

Add a test to verify that navigating to a prefetched main resource
that sets Vary: Cookie does send cookies.

* http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie-expected.txt: Added.
* http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html: Added.
* http/wpt/prefetch/resources/main-resource-cross-origin-set-cookie.py: Added.
(main):
* http/wpt/prefetch/resources/main-resource-cross-origin-vary-cookie.py: Added.
(main):
* http/wpt/prefetch/resources/navigate-cross-origin-vary-cookie.html: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie-expected.txt [new file with mode: 0644]
LayoutTests/http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html [new file with mode: 0644]
LayoutTests/http/wpt/prefetch/resources/main-resource-cross-origin-set-cookie.py [new file with mode: 0644]
LayoutTests/http/wpt/prefetch/resources/main-resource-cross-origin-vary-cookie.py [new file with mode: 0644]
LayoutTests/http/wpt/prefetch/resources/navigate-cross-origin-vary-cookie.html [new file with mode: 0644]
LayoutTests/platform/mac-wk1/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp