-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RedirectSOAuthorizationSession should support all redirections
https://bugs.webkit.org/show_bug.cgi?id=254263 rdar://106379935 Reviewed by Alex Christensen. Handle SSO redirections in the loader code path. This has the benefit of supporting all redirections, including 307 redirections. This also simplifies the UIProcess code path. We need to handle redirections in two ways: - Either the SSO redirection happens while the load has not started. We handle it at DocumentLoader level by enabling to use substitute data for redirections. - Or the SSO redirection happens while the load already started (redirection case). In that case, we register the redirection in network process so that NetworkResourceLoader handles it. We add some tests and need to update some tests as redirections from file URLs to HTTP is not allowed. This new code path is only enabled for 307 redirections on a POST request for now. This patch should not change behavior for other interceptions. In the future, we will probably move all redirections to follow that new code path. Coverd by existing and added API tests. * Source/WebCore/loader/DocumentLoader.cpp: (WebCore::DocumentLoader::handleSubstituteDataLoadNow): (WebCore::DocumentLoader::redirectReceived): (WebCore::DocumentLoader::setRedirectionAsSubstituteData): * Source/WebCore/loader/DocumentLoader.h: * Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::useRedirectionForCurrentNavigation): * Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h: * Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in: * Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::continueWillSendRequest): (WebKit::NetworkResourceLoader::useRedirectionForCurrentNavigation): * Source/WebKit/NetworkProcess/NetworkResourceLoader.h: * Source/WebKit/UIProcess/Cocoa/SOAuthorization/RedirectSOAuthorizationSession.mm: (WebKit::RedirectSOAuthorizationSession::completeInternal): * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::useRedirectionForCurrentNavigation): * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::useRedirectionForCurrentNavigation): * Source/WebKit/WebProcess/WebPage/WebPage.h: * Source/WebKit/WebProcess/WebPage/WebPage.messages.in: * Tools/TestWebKitAPI/Tests/WebKitCocoa/SOAuthorizationTests.mm: (-[TestSOAuthorizationBasicDelegate webView:didFinishNavigation:]): (-[TestSOAuthorizationDelegate webView:didFinishNavigation:]): (-[TestSOAuthorizationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]): (overrideBeginAuthorizationWithURL): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/265706@main
- Loading branch information
Showing
14 changed files
with
382 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.