Title: [243757] trunk
Revision
243757
Author
[email protected]
Date
2019-04-02 13:48:19 -0700 (Tue, 02 Apr 2019)

Log Message

[Fetch API] Allow used body replacement in Request constructor
https://bugs.webkit.org/show_bug.cgi?id=183703
<rdar://problem/49425609>

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test now that one more check is passing.

* web-platform-tests/fetch/api/request/request-disturbed-expected.txt:

Source/WebCore:

Allow used body replacement in Request constructor as per:
- https://github.com/whatwg/fetch/pull/675

No new tests, rebaseline existing test.

* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (243756 => 243757)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2019-04-02 20:30:02 UTC (rev 243756)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2019-04-02 20:48:19 UTC (rev 243757)
@@ -1,5 +1,17 @@
 2019-04-02  Chris Dumez  <[email protected]>
 
+        [Fetch API] Allow used body replacement in Request constructor
+        https://bugs.webkit.org/show_bug.cgi?id=183703
+        <rdar://problem/49425609>
+
+        Reviewed by Youenn Fablet.
+
+        Rebaseline WPT test now that one more check is passing.
+
+        * web-platform-tests/fetch/api/request/request-disturbed-expected.txt:
+
+2019-04-02  Chris Dumez  <[email protected]>
+
         Unreviewed, rolling out r243551.
 
         Seems to have broken file uploads to SoundCloud

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed-expected.txt (243756 => 243757)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed-expected.txt	2019-04-02 20:30:02 UTC (rev 243756)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-disturbed-expected.txt	2019-04-02 20:48:19 UTC (rev 243757)
@@ -3,7 +3,7 @@
 PASS Request without body cannot be disturbed 
 PASS Check cloning a disturbed request 
 PASS Check creating a new request from a disturbed request 
-FAIL Check creating a new request with a new body from a disturbed request Request input is disturbed or locked.
+PASS Check creating a new request with a new body from a disturbed request 
 FAIL Input request used for creating new request became disturbed assert_equals: body should not change expected object "[object ReadableStream]" but got object "[object ReadableStream]"
 FAIL Input request used for creating new request became disturbed even if body is not used assert_true: bodyUsed is true when request is disturbed expected true got false
 PASS Check consuming a disturbed request 

Modified: trunk/Source/WebCore/ChangeLog (243756 => 243757)


--- trunk/Source/WebCore/ChangeLog	2019-04-02 20:30:02 UTC (rev 243756)
+++ trunk/Source/WebCore/ChangeLog	2019-04-02 20:48:19 UTC (rev 243757)
@@ -1,5 +1,21 @@
 2019-04-02  Chris Dumez  <[email protected]>
 
+        [Fetch API] Allow used body replacement in Request constructor
+        https://bugs.webkit.org/show_bug.cgi?id=183703
+        <rdar://problem/49425609>
+
+        Reviewed by Youenn Fablet.
+
+        Allow used body replacement in Request constructor as per:
+        - https://github.com/whatwg/fetch/pull/675
+
+        No new tests, rebaseline existing test.
+
+        * Modules/fetch/FetchRequest.cpp:
+        (WebCore::FetchRequest::initializeWith):
+
+2019-04-02  Chris Dumez  <[email protected]>
+
         Unreviewed, rolling out r243551.
 
         Seems to have broken file uploads to SoundCloud

Modified: trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp (243756 => 243757)


--- trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp	2019-04-02 20:30:02 UTC (rev 243756)
+++ trunk/Source/WebCore/Modules/fetch/FetchRequest.cpp	2019-04-02 20:48:19 UTC (rev 243757)
@@ -203,9 +203,6 @@
 
 ExceptionOr<void> FetchRequest::initializeWith(FetchRequest& input, Init&& init)
 {
-    if (input.isDisturbedOrLocked())
-        return Exception {TypeError, "Request input is disturbed or locked."_s };
-
     m_request = input.m_request;
     m_options = input.m_options;
     m_referrer = input.m_referrer;
@@ -240,6 +237,9 @@
         if (setBodyResult.hasException())
             return setBodyResult.releaseException();
     } else {
+        if (input.isDisturbedOrLocked())
+            return Exception { TypeError, "Request input is disturbed or locked."_s };
+
         auto setBodyResult = setBody(input);
         if (setBodyResult.hasException())
             return setBodyResult.releaseException();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to