Bug 162580

Summary: [WK2][NetworkSession] Ping requests should follow redirects if applicable
Product: WebKit Reporter: Daniel Bates <dbates>
Component: WebKit2Assignee: Daniel Bates <dbates>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: WebKit Local Build   
Hardware: Mac   
OS: macOS 10.12   
Bug Depends on: 162520    
Bug Blocks:    
Attachments:
Description Flags
Patch and Layout Tests achristensen: review+

Description Daniel Bates 2016-09-26 15:32:09 PDT
Ping requests do not follow redirects in WebKit2 with ENABLE(NETWORK_SESSION) enabled. With the exception of violation reports, ping requests should follow redirects per section "Hyperlink auditing" of the HTML standard: <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing>.
Comment 1 Daniel Bates 2016-09-27 16:41:25 PDT
Created attachment 290020 [details]
Patch and Layout Tests
Comment 2 Daniel Bates 2016-09-27 18:02:24 PDT
Patch does not apply because it depends on the change to class NetworkLoadParameters in the patch for bug #162520.
Comment 3 Alex Christensen 2016-09-27 21:42:37 PDT
Comment on attachment 290020 [details]
Patch and Layout Tests

View in context: https://bugs.webkit.org/attachment.cgi?id=290020&action=review

> LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html:30
> +    // FIXME: Is there are better way to test that a redirect occurred?

See my comment in https://bugs.webkit.org/show_bug.cgi?id=162520
Comment 4 Daniel Bates 2016-10-05 07:23:41 PDT
(In reply to comment #3)
> Comment on attachment 290020 [details]
> Patch and Layout Tests
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=290020&action=review
> 
> > LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html:30
> > +    // FIXME: Is there are better way to test that a redirect occurred?
> 
> See my comment in https://bugs.webkit.org/show_bug.cgi?id=162520

Filed bug #162968 to implement a polling approach.
Comment 5 Radar WebKit Bug Importer 2016-10-05 07:24:43 PDT
<rdar://problem/28631274>
Comment 6 Daniel Bates 2016-10-05 07:29:14 PDT
Committed r206810: <http://trac.webkit.org/changeset/206810>
Comment 7 Daniel Bates 2016-10-05 09:34:38 PDT
Renamed test anchor-ping-and-do-not-follow-redirect-when-sending-ping.html to anchor-ping-and-follow-redirect-when-sending-ping.html to reflect what it is actually testing - that we follow a redirect when sending a ping for a <a ping> and modified save-ping-and-redirect-to-save-ping.php to only append the query string if we have a non-empty query string to avoid appending a superfluous "?" on redirect when the query string is the empty string. Committed these changes in <http://trac.webkit.org/changeset/206813>.