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

annevk commented on this pull request.



> +  <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>Set <var>httpRequest</var>'s <a for=request>body</a> to <var>body</var>.
+
+   <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>.
+  </ol>
+
+  <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.

This note is still problematic I think compared to the original. I think it should say something like the following:

> A _request_ is copied as _httpRequest_ here as we need to be able to add headers to _httpRequest_ and read its body without affecting _request_. Namely, _request_ can be reused with redirects, authentication, and proxy authentication. We copy rather than clone in order to reduce memory consumption. In case _request_'s body's source is a ReadableStream object, redirects and authentication will end up failing the fetch.

Does that make sense to you?

-- 
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-15270859

Received on Thursday, 5 January 2017 09:34:35 UTC