Bug 246529

Summary: didReceiveServerRedirectForProvisionalNavigation is not called for 307 redirects
Product: WebKit Reporter: Ali Juma <ajuma>
Component: WebKit APIAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: achristensen, ap, beidson, cdumez
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Ali Juma 2022-10-14 11:55:34 PDT
WKNavigationDelegate's didReceiveServerRedirectForProvisionalNavigation is not called on 307 redirects. For example, this can be tested on URLs that perform a 307 redirection from http to https, such has http://www.google.com or http://www.cbc.ca. 

The missing callback confuses Chrome for iOS's logic for working with navigation items, as we can't easily distinguish a redirect from two consecutive (but otherwise unrelated) navigations.
Comment 1 Alexey Proskuryakov 2022-10-16 18:47:34 PDT
Is this definitely a 307 at play, not Strict-Transport-Security? It's easier to see how the latter would be a special case.
Comment 2 Alexey Proskuryakov 2022-10-16 18:49:26 PDT
Also, http://www.cbc.ca redirects with 301 for me, and http://www.google.com doesn't at all (HTTP 200 without STS).
Comment 3 Ali Juma 2022-10-18 13:01:00 PDT
(In reply to Alexey Proskuryakov from comment #1)
> Is this definitely a 307 at play, not Strict-Transport-Security?

Ah, this turns out to be not 307 at all, but instead WKWebView's upgradeKnownHostsToHTTPS. For clarity, I'll close this bug and file a new one.