213
213
<a>queue a fetch task</a> on <var> request</var> to <a>process request end-of-body</a>
214
214
for <var> request</var> .
215
215
216
- <hr>
217
-
218
- <p> To <dfn>read a <var>request</var></dfn> , if <var> request</var> 's
219
- <a for=request>body</a> is non-null, whenever
220
- <var> request</var> 's <a for=request>body</a> is read from (i.e.
221
- is transmitted or read by script), increase <var> request</var> 's
222
- <a for=request>body</a> 's
223
- <a for=body>transmitted bytes</a> with the amount of payload body
224
- bytes transmitted and then <a>queue a fetch task</a> on <var> request</var> to
225
- <a>process request body</a> for <var> request</var> .
226
- <!-- XXX xref "read", "payload body" -->
227
-
228
216
229
217
<h3 id=http>HTTP</h3>
230
218
@@ -1106,6 +1094,8 @@ or "<code>worker</code>".
1106
1094
<p class=note> See <a for=/>handle fetch</a> for usage of these terms.
1107
1095
[[!SW]]
1108
1096
1097
+ <hr>
1098
+
1109
1099
<p> To <dfn export for=request id=concept-request-clone>clone</dfn> a
1110
1100
<a for=/>request</a> <var> request</var> , run these steps:
1111
1101
@@ -1121,6 +1111,49 @@ or "<code>worker</code>".
1121
1111
<li><p> Return <var> newRequest</var> .
1122
1112
</ol>
1123
1113
1114
+ <hr>
1115
+
1116
+ <p> To <dfn export for=request id=concept-request-transmit-body>transmit body</dfn> for a
1117
+ <a for=/>request</a> <var> request</var> , run these steps:
1118
+
1119
+ <ol>
1120
+ <li> Let <var> body</var> be <var> request</var> 's <a for=request>body</a> .
1121
+
1122
+ <li><p> If <var> body</var> is null, then <a>queue a fetch task</a> on <var> request</var> to
1123
+ <a>process request end-of-body</a> for <var> request</var> and abort these steps.
1124
+
1125
+ <li>
1126
+ <p> Let <var> read</var> be the result of <a lt="read a chunk" for=ReadableStream>reading a
1127
+ chunk</a> from <var> body</var> 's <a for=body>stream</a> .
1128
+
1129
+ <ul>
1130
+ <li>
1131
+ <p> When <var> read</var> is fulfilled with an object whose <code> done</code>
1132
+ property is false and whose <code> value</code> property is a
1133
+ <code> Uint8Array</code> object, run these substeps:
1134
+
1135
+ <ol>
1136
+ <li><p> Let <var> bytes</var> be the <a>byte sequence</a> represented by the
1137
+ <code> Uint8Array</code> object.
1138
+
1139
+ <li><p> Transmit <var> bytes</var> .
1140
+
1141
+ <li><p> Increase <var> body</var> 's <a for=body>transmitted bytes</a> by <var>bytes</var>' s
1142
+ length.
1143
+
1144
+ <li><p> Run the above step again.
1145
+ </ol>
1146
+
1147
+ <li><p> When <var> read</var> is fulfilled with an object whose <code> done</code>
1148
+ property is true, <a>queue a fetch task</a> on <var> request</var> to
1149
+ <a>process request end-of-body</a> for <var> request</var> .
1150
+
1151
+ <li><p> When <var> read</var> is fulfilled with a value that matches with neither of the
1152
+ above patterns, or <var> read</var> is rejected, <a lt=terminated for=fetch>terminate</a> the
1153
+ ongoing fetch with reason <i> fatal</i> .
1154
+ </ul>
1155
+ </ol>
1156
+
1124
1157
1125
1158
<h4 id=responses>Responses</h4>
1126
1159
@@ -2791,7 +2824,7 @@ optional <i>CORS flag</i> and <i>CORS-preflight flag</i>, run these steps:
2791
2824
<p> If <var> response</var> is not null, then run these substeps:
2792
2825
2793
2826
<ol>
2794
- <li><p> <a lt="Read a request">Read <var>request</var></a > .
2827
+ <li><p> <a for=request>Transmit body</a> for <var> request</var> .
2795
2828
2796
2829
<li><p> Set <var> actualResponse</var> to <var> response</var> , if <var> response</var> is not a
2797
2830
<a>filtered response</a> , and to <var> response</var> 's
@@ -3457,7 +3490,7 @@ steps:
3457
3490
"<code> deprecated</code> " state value ought to be a temporary and last resort kind
3458
3491
of option.
3459
3492
3460
- <p> <a lt="Read a request">Read <var>request</var></a > .
3493
+ <p> <a for=request>Transmit body</a> for <var> request</var> .
3461
3494
3462
3495
<li>
3463
3496
<p> Let <var> strategy</var> be an object. The user agent may choose any object.
0 commit comments