WebKit Bugzilla
Attachment 356199 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-20181130195900.patch (text/plain), 8.61 KB, created by
Rob Buis
on 2018-11-30 10:59:00 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2018-11-30 10:59:00 PST
Size:
8.61 KB
patch
obsolete
>Subversion Revision: 238741 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 6148a4e653477e5581b852a056d9a1b9a94e0547..ede8dde28f6277bdb9834ff8d2e4edbc4b0e1a14 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,13 @@ >+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!). >+ >+ * platform/network/mac/ResourceHandleMac.mm: >+ (WebCore::ResourceHandle::willSendRequest): >+ > 2018-11-30 Justin Fan <justin_fan@apple.com> > > [WebGPU] Flesh out WebGPURenderPassDescriptor to match the WebGPU IDL >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 9afb16419533f40e1e8157bab2685c00cf262bf0..82d32b5dc89cc4cf0866c2a741a93ce83b09bf0c 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,13 @@ >+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!). >+ >+ * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: >+ (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection): >+ > 2018-11-30 Per Arne Vollan <pvollan@apple.com> > > Remove invalid character in sandbox introduced in r238703. >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 a14e3b975373e971983d8b4ed96db89e42df1e64..af6a554b2d9f6c6aa2d820fc0f57a66d35b30160 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+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!). >+ >+ * platform/ios/TestExpectations: >+ * platform/mac/http/tests/xmlhttprequest/head-redirection-expected.txt: Removed. >+ > 2018-11-30 Justin Fan <justin_fan@apple.com> > > [WebGPU] Flesh out WebGPURenderPassDescriptor to match the WebGPU IDL >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 0b06b28f398a7073d956e82762a238939025f031..ed79e6225bbfc2e93f182e4b371a896cd0879a14 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,13 @@ >+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!). >+ >+ * 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