You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the {{Body/blob()}} method's definition with:
1010
1011
1011
-
Insert the following step after step 2 of step 3 of Fetch's <a>consume
1012
-
body</a> algorithm:
1012
+
1. If the <aattributefor="Body">opaque flag</a> is set, return a
1013
+
<code>Promise</code> rejected with a <code>TypeError</code>.
1013
1014
1014
-
<olstart="3">
1015
-
<li>
1016
-
If <var>object</var>'s <a>opaque request flag</a> is set, set
1017
-
<var>stream</var> to an empty byte sequence.
1018
-
</li>
1019
-
</ol>
1015
+
2. Return the result of running <a>consume body</a> with
1016
+
<var>Blob</var>.
1020
1017
1021
-
<h5id="monkey-patching-fetch-4">Fetch: Extract a byte stream</h5>
1018
+
Replace the {{Body/formData()}} method's definition with:
1022
1019
1023
-
Redefine the {{FormData}} case of Fetch's <alt="extract">extract a byte
1024
-
stream and <code>Content-Type</code></a> algorithm as follows:
1020
+
1. If the <aattributefor="Body">opaque flag</a> is set, return a
1021
+
<code>Promise</code> rejected with a <code>TypeError</code>.
1025
1022
1026
-
<ol>
1027
-
<li>
1028
-
If <var>object</var>'s <a>opaque flag</a> is <strong>not</strong> set,
1029
-
or if the extraction algorithm is being executed in the context of
1030
-
{{XMLHttpRequest}}'s {{XMLHttpRequest/send()}} method or Fetch's
1031
-
{{Request()}} constructor, then:
1023
+
2. Return the result of running <a>consume body</a> with
1024
+
<var>FormData</var>.
1032
1025
1033
-
<ol>
1034
-
<li>
1035
-
Push the result of running the multipart/form-data encoding algorithm, with object as form data set and with utf-8 as the explicit character encoding, to stream.
1036
-
</li>
1037
-
<li>
1038
-
Set Content-Type to `multipart/form-data;boundary=`, followed by the multipart/form-data boundary string generated by the multipart/form-data encoding algorithm.
1039
-
</li>
1040
-
</ol>
1026
+
Replace the {{Body/json()}} method's definition with:
1041
1027
1042
-
</li>
1043
-
<li>
1044
-
Otherwise, set <var>Content-Type</var> to <code>text/plain;charset=UTF-8</code>.
1028
+
1. If the <aattributefor="Body">opaque flag</a> is set, return a
1029
+
<code>Promise</code> rejected with a <code>TypeError</code>.
1030
+
1031
+
2. Return the result of running <a>consume body</a> with
1032
+
<var>JSON</var>.
1033
+
1034
+
Replace the {{Body/text()}} method's definition with:
1035
+
1036
+
1. If the <aattributefor="Body">opaque flag</a> is set, return a
1037
+
<code>Promise</code> rejected with a <code>TypeError</code>.
1045
1038
1046
-
Note: In this case (e.g. <var>object</var> is opaque
1047
-
and the algorithm isn't being executed as a result of
1048
-
<code>XHR.send()</code>), <var>stream</var> will remain an empty byte
1049
-
stream.
1039
+
2. Return the result of running <a>consume body</a> with
1040
+
<var>text</var>.
1041
+
1042
+
Note: We reject each of the accessor methods' <code>Promise</code>s, which
0 commit comments