WebKit Bugzilla
Attachment 356233 Details for
Bug 114965
: [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-114965-20181130230535.patch (text/plain), 9.80 KB, created by
Rob Buis
on 2018-11-30 14:05:35 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2018-11-30 14:05:35 PST
Size:
9.80 KB
patch
obsolete
>Subversion Revision: 238746 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0abaa4022a9a3f28c453869eeb5ffb1b79640132..0a0acd51ac867cba712f8fa114abd298dd31a337 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-11-30 Rob Buis <rbuis@igalia.com> >+ >+ [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html) >+ https://bugs.webkit.org/show_bug.cgi?id=114965 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ HEAD requests should not be changed to GET after 303 redirects, see [1]. >+ This was fixed earlier for GTK [2]. >+ >+ Behavior matches Firefox and Chrome. >+ >+ [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4 >+ [2] https://bugs.webkit.org/show_bug.cgi?id=110127 >+ >+ Tests: web-platform-tests/fetch/api/redirect/redirect-method.html >+ web-platform-tests/fetch/api/redirect/redirect-method-worker.html >+ http/tests/xmlhttprequest/head-redirection.html >+ >+ * platform/network/mac/ResourceHandleMac.mm: >+ (WebCore::ResourceHandle::willSendRequest): >+ > 2018-11-30 Basuke Suzuki <basuke.suzuki@sony.com> > > [Curl] Add API for ProtectionSpace. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index d66c3c15b208511f610125b4a1812af2e0291892..68d0a9bd366c235c4aee26ad87dfaf53503f8004 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,25 @@ >+2018-11-30 Rob Buis <rbuis@igalia.com> >+ >+ [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html) >+ https://bugs.webkit.org/show_bug.cgi?id=114965 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ HEAD requests should not be changed to GET after 303 redirects, see [1]. >+ This was fixed earlier for GTK [2]. >+ >+ Behavior matches Firefox and Chrome. >+ >+ [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4 >+ [2] https://bugs.webkit.org/show_bug.cgi?id=110127 >+ >+ Tests: web-platform-tests/fetch/api/redirect/redirect-method.html >+ web-platform-tests/fetch/api/redirect/redirect-method-worker.html >+ http/tests/xmlhttprequest/head-redirection.html >+ >+ * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: >+ (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): >+ > 2018-11-30 Alex Christensen <achristensen@webkit.org> > > Remove unused WebProcessCreationParameters.uiProcessCookieStorageIdentifier >diff --git a/Source/WebCore/platform/network/mac/ResourceHandleMac.mm b/Source/WebCore/platform/network/mac/ResourceHandleMac.mm >index e7759eb4754a3511c7879e88bbd994af8217b534..7a9181f6f9267fe0b553db4ae4c590f888a42648 100644 >--- a/Source/WebCore/platform/network/mac/ResourceHandleMac.mm >+++ b/Source/WebCore/platform/network/mac/ResourceHandleMac.mm >@@ -427,7 +427,8 @@ void ResourceHandle::willSendRequest(ResourceRequest&& request, ResourceResponse > if (!originalContentType.isEmpty()) > request.setHTTPHeaderField(HTTPHeaderName::ContentType, originalContentType); > } >- } >+ } else if (redirectResponse.httpStatusCode() == 303 && equalLettersIgnoringASCIICase(d->m_firstRequest.httpMethod(), "head")) >+ request.setHTTPMethod("HEAD"_s); > > // Should not set Referer after a redirect from a secure resource to non-secure one. > if (!request.url().protocolIs("https") && protocolIs(request.httpReferrer(), "https") && d->m_context->shouldClearReferrerOnHTTPSToHTTPRedirect()) >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >index 94c26204eeea4bace84c2175ee14e8f006c9de4c..1a7c010b35a65f75ef64924704527ca5c27d934a 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >@@ -307,7 +307,8 @@ void NetworkDataTaskCocoa::willPerformHTTPRedirection(WebCore::ResourceResponse& > String originalContentType = m_firstRequest.httpContentType(); > if (!originalContentType.isEmpty()) > request.setHTTPHeaderField(WebCore::HTTPHeaderName::ContentType, originalContentType); >- } >+ } else if (redirectResponse.httpStatusCode() == 303 && equalLettersIgnoringASCIICase(m_firstRequest.httpMethod(), "head")) >+ request.setHTTPMethod("HEAD"_s); > > // Should not set Referer after a redirect from a secure resource to non-secure one. > if (m_shouldClearReferrerOnHTTPSToHTTPRedirect && !request.url().protocolIs("https") && WebCore::protocolIs(request.httpReferrer(), "https")) >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 5bd3cfc9e44e636ad554deb4b6680bc97c134aef..585696a9e6ec5e1dac743c35cd11b58a0602edf1 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-11-30 Rob Buis <rbuis@igalia.com> >+ >+ [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html) >+ https://bugs.webkit.org/show_bug.cgi?id=114965 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update these since we now expect to pass head-redirection.html here. >+ >+ * platform/ios/TestExpectations: >+ * platform/mac/http/tests/xmlhttprequest/head-redirection-expected.txt: Removed. >+ > 2018-11-30 Devin Rousso <drousso@apple.com> > > Web Inspector: replace all unicode characters with the escaped character code >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 0b06b28f398a7073d956e82762a238939025f031..d2ff696edaf7dd7bd64b251c523501b3b2fa2391 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,15 @@ >+2018-11-30 Rob Buis <rbuis@igalia.com> >+ >+ [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html) >+ https://bugs.webkit.org/show_bug.cgi?id=114965 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update test expectations. >+ >+ * web-platform-tests/fetch/api/redirect/redirect-method-expected.txt: >+ * web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt: >+ > 2018-11-28 Ryosuke Niwa <rniwa@webkit.org> > > Update web-platform-tests/shadow-dom >diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt >index 24af5ffe774d10ce6e1bc09037a91623279b111e..ae32d5146630f4ab54bb46487700646d606dd68f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-expected.txt >@@ -8,7 +8,7 @@ PASS Redirect 302 with POST > PASS Redirect 302 with HEAD > PASS Redirect 303 with GET > PASS Redirect 303 with POST >-FAIL Redirect 303 with HEAD assert_equals: Request method after redirection is HEAD expected "HEAD" but got "GET" >+PASS Redirect 303 with HEAD > PASS Redirect 307 with GET > PASS Redirect 307 with POST (string body) > PASS Redirect 307 with POST (blob body) >diff --git a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt >index 24af5ffe774d10ce6e1bc09037a91623279b111e..ae32d5146630f4ab54bb46487700646d606dd68f 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/fetch/api/redirect/redirect-method-worker-expected.txt >@@ -8,7 +8,7 @@ PASS Redirect 302 with POST > PASS Redirect 302 with HEAD > PASS Redirect 303 with GET > PASS Redirect 303 with POST >-FAIL Redirect 303 with HEAD assert_equals: Request method after redirection is HEAD expected "HEAD" but got "GET" >+PASS Redirect 303 with HEAD > PASS Redirect 307 with GET > PASS Redirect 307 with POST (string body) > PASS Redirect 307 with POST (blob body) >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index 4a9d5ab8c855c779c310a6fdb35c76069412daa8..e2a27ce3e0d7123877af95c462ed4576aa9c47c9 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -1550,7 +1550,6 @@ http/tests/webarchive/test-css-url-encoding.html > # XMLHttpRequest tests that fail: > http/tests/xmlhttprequest/basic-auth-nopassword.html [ Failure ] > http/tests/xmlhttprequest/default-content-type-dashboard.html [ Failure ] >-http/tests/xmlhttprequest/head-redirection.html [ Failure ] > > # DeviceMotion tests that time out: > fast/dom/DeviceMotion/no-page-cache.html >diff --git a/LayoutTests/platform/mac/http/tests/xmlhttprequest/head-redirection-expected.txt b/LayoutTests/platform/mac/http/tests/xmlhttprequest/head-redirection-expected.txt >deleted file mode 100644 >index 005ac614571745c1ca9c7dec3bfb74bd56454167..0000000000000000000000000000000000000000 >--- a/LayoutTests/platform/mac/http/tests/xmlhttprequest/head-redirection-expected.txt >+++ /dev/null >@@ -1,10 +0,0 @@ >-This page tests redirection of HEAD requests with different codes (301, 302, 303, 307). >-As described in http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics (in particular sections 7.4.2, 7.4.3, 7.4.4 and 7.4.7 as of version 22 of the document), a redirected HEAD request is expected to remain a HEAD request. >- >-This test loads a web page that does a XHR HEAD request to a first script. This script does a redirection to a second script that sends a response containing the request method as a HTTP header. >- >-HEAD-301 - expected HEAD and received HEAD >-HEAD-302 - expected HEAD and received HEAD >-HEAD-303 - expected HEAD and received GET >-HEAD-307 - expected HEAD and received HEAD >-
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 114965
:
356168
|
356169
|
356175
|
356181
|
356186
|
356199
|
356233
|
356593