Changeset 244813 in webkit


Ignore:
Timestamp:
Apr 30, 2019 4:56:20 PM (5 years ago)
Author:
youenn@apple.com
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:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r244808 r244813  
     12019-04-30  Youenn Fablet  <youenn@apple.com>
     2
     3        [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
     4        https://bugs.webkit.org/show_bug.cgi?id=196864
     5        <rdar://problem/49854497>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * platform/mac-wk1/TestExpectations:
     10
    1112019-04-30  Shawn Roberts  <sroberts@apple.com>
    212
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r244776 r244813  
     12019-04-30  Youenn Fablet  <youenn@apple.com>
     2
     3        [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
     4        https://bugs.webkit.org/show_bug.cgi?id=196864
     5        <rdar://problem/49854497>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * web-platform-tests/xhr/send-redirect-post-upload-expected.txt:
     10
    1112019-04-30  Youenn Fablet  <youenn@apple.com>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/xhr/send-redirect-post-upload-expected.txt

    r235354 r244813  
    33PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (302)
    44PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (303)
    5 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
     5PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (307 (string))
     6PASS XMLHttpRequest: The send() method: POSTing to URL that redirects (307 (blob))
    67
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r244582 r244813  
    433433
    434434webkit.org/b/159893 [ Debug ] imported/w3c/web-platform-tests/xhr/event-readystatechange-loaded.htm [ Pass Failure ]
    435 webkit.org/b/196864 [ Debug ] imported/w3c/web-platform-tests/xhr/event-upload-progress.htm [ Skip ]
    436435
    437436webkit.org/b/160101 userscripts/window-onerror-for-isolated-world-3.html [ Pass Failure ]
     
    699698webkit.org/b/195098 pointerevents/mouse/pointer-events-before-mouse-events.html [ Failure ]
    700699
    701 webkit.org/b/159724 [ Debug ] imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm [ Skip ]
    702 
    703700webkit.org/b/196448 [ Debug ] inspector/audit/basic.html [ Pass Timeout ]
    704701
  • trunk/Source/WebCore/ChangeLog

    r244801 r244813  
     12019-04-30  Youenn Fablet  <youenn@apple.com>
     2
     3        [macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
     4        https://bugs.webkit.org/show_bug.cgi?id=196864
     5        <rdar://problem/49854497>
     6
     7        Reviewed by Alex Christensen.
     8
     9        In case of redirection, it is sometimes not possible to retrieve the form data
     10        from its NSInputStream in case of redirections.
     11        To handle this case, reuse the first request form data if the new request has a body.
     12        We also clear the HTTP content type in such a case if the original request has no content type.
     13
     14        Covered by re-enabled tests.
     15
     16        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
     17        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
     18
    1192019-04-30  Commit Queue  <commit-queue@webkit.org>
    220
  • trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm

    r239427 r244813  
    140140        }
    141141
    142         m_handle->willSendRequest(newRequest.get(), redirectResponse.get(), [self, protectedSelf = WTFMove(protectedSelf)](ResourceRequest&& request) {
     142        ResourceRequest redirectRequest = newRequest.get();
     143        if ([newRequest.get() HTTPBodyStream]) {
     144            ASSERT(m_handle->firstRequest().httpBody());
     145            redirectRequest.setHTTPBody(m_handle->firstRequest().httpBody());
     146        }
     147        if (m_handle->firstRequest().httpContentType().isEmpty())
     148            redirectRequest.clearHTTPContentType();
     149        m_handle->willSendRequest(WTFMove(redirectRequest), redirectResponse.get(), [self, protectedSelf = WTFMove(protectedSelf)](ResourceRequest&& request) {
    143150            m_requestResult = request.nsURLRequest(HTTPBodyUpdatePolicy::UpdateHTTPBody);
    144151            m_semaphore.signal();
Note: See TracChangeset for help on using the changeset viewer.