Title: [244813] trunk
Revision
244813
Author
[email protected]
Date
2019-04-30 16:56:20 -0700 (Tue, 30 Apr 2019)

Log Message

[macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
https://bugs.webkit.org/show_bug.cgi?id=196864
<rdar://problem/49854497>

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/xhr/send-redirect-post-upload-expected.txt:

Source/WebCore:

In case of redirection, it is sometimes not possible to retrieve the form data
from its NSInputStream in case of redirections.
To handle this case, reuse the first request form data if the new request has a body.
We also clear the HTTP content type in such a case if the original request has no content type.

Covered by re-enabled tests.

* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):

LayoutTests:

* platform/mac-wk1/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (244812 => 244813)


--- trunk/LayoutTests/ChangeLog	2019-04-30 23:56:05 UTC (rev 244812)
+++ trunk/LayoutTests/ChangeLog	2019-04-30 23:56:20 UTC (rev 244813)
@@ -1,3 +1,13 @@
+2019-04-30  Youenn Fablet  <[email protected]>
+
+        [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
+        https://bugs.webkit.org/show_bug.cgi?id=196864
+        <rdar://problem/49854497>
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac-wk1/TestExpectations:
+
 2019-04-30  Shawn Roberts  <[email protected]>
 
         imported/w3c/web-platform-tests/xhr/event-upload-progress-crossorigin.htm is a flaky failure

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (244812 => 244813)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-04-30 23:56:05 UTC (rev 244812)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-04-30 23:56:20 UTC (rev 244813)
@@ -1,5 +1,15 @@
 2019-04-30  Youenn Fablet  <[email protected]>
 
+        [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
+        https://bugs.webkit.org/show_bug.cgi?id=196864
+        <rdar://problem/49854497>
+
+        Reviewed by Alex Christensen.
+
+        * web-platform-tests/xhr/send-redirect-post-upload-expected.txt:
+
+2019-04-30  Youenn Fablet  <[email protected]>
+
         Update WPT service-worker resource-timing test to use hosts[alt]
         https://bugs.webkit.org/show_bug.cgi?id=197329
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/xhr/send-redirect-post-upload-expected.txt (244812 => 244813)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/xhr/send-redirect-post-upload-expected.txt	2019-04-30 23:56:05 UTC (rev 244812)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/xhr/send-redirect-post-upload-expected.txt	2019-04-30 23:56:20 UTC (rev 244813)
@@ -2,5 +2,6 @@
 PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (301) 
 PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (302) 
 PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (303) 
-FAIL XMLHttpRequest: The send() method: POSTing to URL that redirects (307) assert_array_equals: events firing in expected order and states lengths differ, expected 9 got 10
+PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (307 (string)) 
+PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (307 (blob)) 
 

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (244812 => 244813)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2019-04-30 23:56:05 UTC (rev 244812)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2019-04-30 23:56:20 UTC (rev 244813)
@@ -432,7 +432,6 @@
 [ Sierra+ ] svg/hixie/text/003.html [ Failure ]
 
 webkit.org/b/159893 [ Debug ] imported/w3c/web-platform-tests/xhr/event-readystatechange-loaded.htm [ Pass Failure ]
-webkit.org/b/196864 [ Debug ] imported/w3c/web-platform-tests/xhr/event-upload-progress.htm [ Skip ]
 
 webkit.org/b/160101 userscripts/window-onerror-for-isolated-world-3.html [ Pass Failure ]
 
@@ -698,8 +697,6 @@
 webkit.org/b/195098 pointerevents/mouse/pointer-capture.html [ Failure ]
 webkit.org/b/195098 pointerevents/mouse/pointer-events-before-mouse-events.html [ Failure ]
 
-webkit.org/b/159724 [ Debug ] imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm [ Skip ]
-
 webkit.org/b/196448 [ Debug ] inspector/audit/basic.html [ Pass Timeout ]
 
 webkit.org/b/196502 media/video-background-tab-playback.html [ Pass Failure ]

Modified: trunk/Source/WebCore/ChangeLog (244812 => 244813)


--- trunk/Source/WebCore/ChangeLog	2019-04-30 23:56:05 UTC (rev 244812)
+++ trunk/Source/WebCore/ChangeLog	2019-04-30 23:56:20 UTC (rev 244813)
@@ -1,3 +1,21 @@
+2019-04-30  Youenn Fablet  <[email protected]>
+
+        [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
+        https://bugs.webkit.org/show_bug.cgi?id=196864
+        <rdar://problem/49854497>
+
+        Reviewed by Alex Christensen.
+
+        In case of redirection, it is sometimes not possible to retrieve the form data
+        from its NSInputStream in case of redirections.
+        To handle this case, reuse the first request form data if the new request has a body.
+        We also clear the HTTP content type in such a case if the original request has no content type.
+
+        Covered by re-enabled tests.
+
+        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
+
 2019-04-30  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r244773.

Modified: trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm (244812 => 244813)


--- trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm	2019-04-30 23:56:05 UTC (rev 244812)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm	2019-04-30 23:56:20 UTC (rev 244813)
@@ -139,7 +139,14 @@
             return;
         }
 
-        m_handle->willSendRequest(newRequest.get(), redirectResponse.get(), [self, protectedSelf = WTFMove(protectedSelf)](ResourceRequest&& request) {
+        ResourceRequest redirectRequest = newRequest.get();
+        if ([newRequest.get() HTTPBodyStream]) {
+            ASSERT(m_handle->firstRequest().httpBody());
+            redirectRequest.setHTTPBody(m_handle->firstRequest().httpBody());
+        }
+        if (m_handle->firstRequest().httpContentType().isEmpty())
+            redirectRequest.clearHTTPContentType();
+        m_handle->willSendRequest(WTFMove(redirectRequest), redirectResponse.get(), [self, protectedSelf = WTFMove(protectedSelf)](ResourceRequest&& request) {
             m_requestResult = request.nsURLRequest(HTTPBodyUpdatePolicy::UpdateHTTPBody);
             m_semaphore.signal();
         });
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to