Changeset 273905 in webkit
- Timestamp:
- Mar 4, 2021 11:30:12 AM (17 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/fetch/navigation-post-to-get-origin-expected.txt (added)
-
LayoutTests/http/wpt/fetch/navigation-post-to-get-origin.html (added)
-
LayoutTests/http/wpt/fetch/resources/echo-origin.py (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/loader/DocumentLoader.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r273902 r273905 1 2021-03-04 Youenn Fablet <youenn@apple.com> 2 3 In case of POST navigation redirected by a 302, the 'Origin' header is kept in the redirected request 4 https://bugs.webkit.org/show_bug.cgi?id=222653 5 <rdar://problem/74983521> 6 7 Reviewed by Alex Christensen. 8 9 * http/wpt/fetch/echo-origin.py: Added. 10 * http/wpt/fetch/navigation-post-to-get-origin-expected.txt: Added. 11 * http/wpt/fetch/navigation-post-to-get-origin.html: Added. 12 1 13 2021-03-04 Said Abou-Hallawa <said@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r273903 r273905 1 2021-03-04 Youenn Fablet <youenn@apple.com> 2 3 In case of POST navigation redirected by a 302, the 'Origin' header is kept in the redirected request 4 https://bugs.webkit.org/show_bug.cgi?id=222653 5 <rdar://problem/74983521> 6 7 Reviewed by Alex Christensen. 8 9 Remove Origin header if the navigation request goes from POST to GET. 10 This aligns with other browsers and removes some known interop issues. 11 This is consistent with WebKit not sending Origin headers for GET navigations. 12 13 Test: http/wpt/fetch/navigation-post-to-get-origin.html 14 15 * loader/DocumentLoader.cpp: 16 (WebCore::isRedirectToGetAfterPost): 17 (WebCore::DocumentLoader::willSendRequest): 18 1 19 2021-03-04 Chris Dumez <cdumez@apple.com> 2 20 -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r273183 r273905 496 496 } 497 497 498 static bool isRedirectToGetAfterPost(const ResourceRequest& oldRequest, const ResourceRequest& newRequest) 499 { 500 return oldRequest.httpMethod() == "POST" && newRequest.httpMethod() == "GET"; 501 } 502 498 503 bool DocumentLoader::isPostOrRedirectAfterPost(const ResourceRequest& newRequest, const ResourceResponse& redirectResponse) 499 504 { … … 660 665 if (newRequest.cachePolicy() == ResourceRequestCachePolicy::UseProtocolCachePolicy && isPostOrRedirectAfterPost(newRequest, redirectResponse)) 661 666 newRequest.setCachePolicy(ResourceRequestCachePolicy::ReloadIgnoringCacheData); 667 668 if (isRedirectToGetAfterPost(m_request, newRequest)) 669 newRequest.clearHTTPOrigin(); 662 670 663 671 if (&topFrame != m_frame) {
Note: See TracChangeset
for help on using the changeset viewer.