Skip to content

Commit 6453947

Browse files
authored
Add a limited size buffer for streaming upload in HTTP request
No testing possible, tracked in web-platform-tests/wpt#28568. Fixes #538.
1 parent fc6f26f commit 6453947

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

fetch.bs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5091,6 +5091,26 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
50915091
<ul>
50925092
<li><p>Follow the relevant requirements from HTTP. [[!HTTP]] [[!HTTP-SEMANTICS]] [[!HTTP-COND]] [[!HTTP-CACHING]] [[!HTTP-AUTH]]
50935093

5094+
<li>
5095+
<p>If <var>request</var>'s <a for=request>body</a> is non-null, and <var>request</var>'s
5096+
<a for=request>body</a>'s <a for=body>source</a> is null, then the user agent may have a
5097+
buffer of up to 64 kibibytes and store a part of <var>request</var>'s <a for=request>body</a>
5098+
in that buffer. If the user agent reads from <var>request</var>'s <a for=request>body</a>
5099+
beyond that buffer's size and the user agent needs to resend <var>request</var>, then instead
5100+
return a <a>network error</a>.
5101+
5102+
<div class=note>
5103+
<p>The resending is needed when the connection is timed out, for example.
5104+
5105+
<p>The buffer is not needed when <var>request</var>'s <a for=request>body</a>'s
5106+
<a for=body>source</a> is non-null, because <var>request</var>'s <a for=request>body</a> can
5107+
be recreated from it.
5108+
5109+
<p>When <var>request</var>'s <a for=request>body</a>'s <a for=body>source</a> is null, it
5110+
means <a for=request>body</a> is created from a {{ReadableStream}} object, which means
5111+
<a for=request>body</a> cannot be recreated and that is why the buffer is needed.
5112+
</div>
5113+
50945114
<li><p>Set <var>timingInfo</var>'s
50955115
<a for="fetch timing info">final network-response start time</a> to the
50965116
<a for=/>coarsened shared current time</a> given <var>fetchParams</var>'s

0 commit comments

Comments
 (0)