Re: [whatwg/fetch] Uploading a Request made from a ReadableStream body (#425)

annevk commented on this pull request.



> -  <var>request</var> is reused with redirects, authentication, and proxy authentication.
+  <ol>
+   <li><p>Set <var>httpRequest</var> to a copy of <var>request</var> except for its
+   <a for=request>body</a>.
+
+   <li><p>Let <var>body</var> be <var>request</var>'s <a for=request>body</a>.
+
+   <li>
+    <p>If <var>body</var> is non-null, then set <var>request</var>'s <a for=request>body</a> to a
+    new <a for=/>body</a> whose <a for=body>stream</a> is null and whose <a for=body>source</a> is
+    <var>body</var>'s <a for=body>source</a>.
+
+    <p class="note no-backref">Here we do not <a for=request>clone</a> <var>request</var> in order
+    to reduce memory consumption. <var>request</var> can be reused with redirects, authentication,
+    and proxy authentication.
+  </ol>

This still seems wrong. Shouldn't we be setting _httpRequest_'s body rather than that of _request_? Also, what happens to _request_'s body?

The note should probably also move to after the `</ol>` closing tag. We copy and move body around to preserve memory consumption. And we copy in the first place since it needs to be possible to add headers without affecting _request_, as _request_ is reused with redirects et al. It seems you dropped part of that note, but we should keep that.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/pull/425#pullrequestreview-13541999

Received on Monday, 19 December 2016 12:28:07 UTC