Skip to content

Introduce RequestInit.duplex #1457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6784,6 +6784,7 @@ dictionary RequestInit {
DOMString integrity;
boolean keepalive;
AbortSignal? signal;
RequestDuplex duplex;
any window; // can only be set to null
};

Expand All @@ -6792,6 +6793,7 @@ enum RequestMode { "navigate", "same-origin", "no-cors", "cors" };
enum RequestCredentials { "omit", "same-origin", "include" };
enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" };
enum RequestRedirect { "follow", "error", "manual" };
enum RequestDuplex { "half" };
</pre>

<p class="note no-backref">"<code>serviceworker</code>" is omitted from
Expand Down Expand Up @@ -6880,6 +6882,15 @@ object), initially null.

<dt>{{RequestInit/window}}
<dd>Can only be null. Used to disassociate <var>request</var> from any {{Window}}.

<dt>{{RequestInit/duplex}}
<dd>"<code>half</code>" is the only valid value and it is for initiating a half-duplex fetch
(i.e., the user agent sends the entire request before processing the response).
"<code>full</code>" is reserved for future use, for initiating a full-duplex fetch (i.e., the
user agent can process the response before sending the entire request). This member needs to be
set when {{RequestInit/body}} is a {{ReadableStream}} object. <span class=note>See
<a href="https://github.com/whatwg/fetch/issues/1254">issue #1254</a> for defining
"<code>full</code>".</span>
</dl>

<dt><code><var>request</var> . <a attribute for=Request>method</a></code>
Expand Down Expand Up @@ -7310,6 +7321,9 @@ constructor steps are:
<a for=body>source</a> is null, then:

<ol>
<li><p>If <var>initBody</var> is non-null and <var>init</var>["{{RequestInit/duplex}}"] does
not <a for=map>exist</a>, then throw a {{TypeError}}.

<li><p>If <a>this</a>'s <a for=Request>request</a>'s <a for=request>mode</a> is neither
"<code>same-origin</code>" nor "<code>cors</code>", then throw a {{TypeError}}.

Expand Down