SubFrameSOAuthorizationSession should preserve the referrer header when fall back...
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Jun 2019 06:33:50 +0000 (06:33 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Jun 2019 06:33:50 +0000 (06:33 +0000)
commit0396416c06f8dcdc634b23ad9eb9e3e7b09b5d63
treeb97c0d011ebf5ba48be2cbb6ce64af05b221de96
parent960d5ca06365eef8f0f8f80e6379b6a7238322b7
SubFrameSOAuthorizationSession should preserve the referrer header when fall back to web path
https://bugs.webkit.org/show_bug.cgi?id=199232
<rdar://problem/51718328>

Reviewed by Youenn Fablet.

Source/WebKit:

The fall back to web path mechanism in SubFrameSOAuthorizationSession doesn't actually resume
the previous navigation. Instead it starts a new one. The current implementation doesn't carry
any information from the previous navigation. It is problematic when it comes to http referrer
as the server might use that to determine what kind of responses to send back. Therefore, we
add that information now.

To accomplish the above, the patch teaches WebFrameProxy::loadURL to carry referrer information
when it is available. Then SubFrameSOAuthorizationSession can reuses the referrer from the
original request.

* UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
(WebKit::SubFrameSOAuthorizationSession::fallBackToWebPathInternal):
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::loadURL):
* UIProcess/WebFrameProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadURLInFrame):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(TestWebKitAPI::TEST):
Add a test that utilizes TCPServer as local files always omit referrer.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm
Source/WebKit/UIProcess/WebFrameProxy.cpp
Source/WebKit/UIProcess/WebFrameProxy.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm