diff options
author | Luca Casonato <hello@lcas.dev> | 2024-08-26 12:24:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-26 12:24:27 +0200 |
commit | e53678fd5841fe7b94f8f9e16d6521201a3d2993 (patch) | |
tree | 8954b7d1e04f3319c3c71b7b7f9ca16529a8edd5 /ext/fetch | |
parent | 675539c7ab503e5a5bdef1d17678afb7b8dc352b (diff) |
Revert "feat(fetch): accept async iterables for body" (#25207)
Unfortunately this caused a regression:
https://github.com/denoland/deno/issues/25203.
Need to do some more upstream spec work to fix this before this can be
re-landed.
Reverts denoland/deno#24623
Diffstat (limited to 'ext/fetch')
-rw-r--r-- | ext/fetch/22_body.js | 13 | ||||
-rw-r--r-- | ext/fetch/lib.deno_fetch.d.ts | 1 |
2 files changed, 0 insertions, 14 deletions
diff --git a/ext/fetch/22_body.js b/ext/fetch/22_body.js index ae5aef8ac..82f41411d 100644 --- a/ext/fetch/22_body.js +++ b/ext/fetch/22_body.js @@ -458,8 +458,6 @@ function extractBody(object) { if (object.locked || isReadableStreamDisturbed(object)) { throw new TypeError("ReadableStream is locked or disturbed"); } - } else if (object[webidl.AsyncIterable] === webidl.AsyncIterable) { - stream = ReadableStream.from(object.open()); } if (typeof source === "string") { // WARNING: this deviates from spec (expects length to be set) @@ -477,9 +475,6 @@ function extractBody(object) { return { body, contentType }; } -webidl.converters["async iterable<Uint8Array>"] = webidl - .createAsyncIterableConverter(webidl.converters.Uint8Array); - webidl.converters["BodyInit_DOMString"] = (V, prefix, context, opts) => { // Union for (ReadableStream or Blob or ArrayBufferView or ArrayBuffer or FormData or URLSearchParams or USVString) if (ObjectPrototypeIsPrototypeOf(ReadableStreamPrototype, V)) { @@ -498,14 +493,6 @@ webidl.converters["BodyInit_DOMString"] = (V, prefix, context, opts) => { if (ArrayBufferIsView(V)) { return webidl.converters["ArrayBufferView"](V, prefix, context, opts); } - if (webidl.isAsyncIterator(V)) { - return webidl.converters["async iterable<Uint8Array>"]( - V, - prefix, - context, - opts, - ); - } } // BodyInit conversion is passed to extractBody(), which calls core.encode(). // core.encode() will UTF-8 encode strings with replacement, being equivalent to the USV normalization. diff --git a/ext/fetch/lib.deno_fetch.d.ts b/ext/fetch/lib.deno_fetch.d.ts index 3bf608cdb..c27313903 100644 --- a/ext/fetch/lib.deno_fetch.d.ts +++ b/ext/fetch/lib.deno_fetch.d.ts @@ -163,7 +163,6 @@ declare type BodyInit = | FormData | URLSearchParams | ReadableStream<Uint8Array> - | AsyncIterable<Uint8Array> | string; /** @category Fetch */ declare type RequestDestination = |