Network cache: Subresource referer header wrong after cached redirect
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Oct 2015 18:09:07 +0000 (18:09 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Oct 2015 18:09:07 +0000 (18:09 +0000)
commit82d1f586f6344d1ac57c0e419b0f14c2f9ca4957
treef1b65c5bc28e593f3cd88003fdad0d6bd72e2bbc
parentf07c2e557f743bb9079e8380b8f8fba404a3be14
Network cache: Subresource referer header wrong after cached redirect
https://bugs.webkit.org/show_bug.cgi?id=149709
rdar://problem/22917174

Reviewed by Chris Dumez.

Source/WebKit2:

If a main resource is loaded from a cache entry that involved redirects the document
will end up setting the Referer-headers of the subresources to the request URL not the redirected URL

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):

    If a cache entry involved a redirect synthesize a minimal willSendRequest message so that WebCore side
    runs through the same code paths as when receiving a redirect from network.

LayoutTests:

* http/tests/cache/redirect-referer-expected.html: Added.
* http/tests/cache/redirect-referer.html: Added.
* http/tests/cache/resources/load-and-check-referer.php: Added.
* http/tests/cache/resources/permanent-redirect.php: Added.
* http/tests/cache/resources/redirect-referer-iframe.html: Added.
* http/tests/cache/resources/redirect-referer-iframe-expected.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/cache/redirect-referer-expected.html [new file with mode: 0644]
LayoutTests/http/tests/cache/redirect-referer.html [new file with mode: 0644]
LayoutTests/http/tests/cache/resources/load-and-check-referer.php [new file with mode: 0644]
LayoutTests/http/tests/cache/resources/permanent-redirect.php [new file with mode: 0644]
LayoutTests/http/tests/cache/resources/redirect-referer-iframe-expected.html [new file with mode: 0644]
LayoutTests/http/tests/cache/resources/redirect-referer-iframe.html [new file with mode: 0644]
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp