summaryrefslogtreecommitdiff
path: root/ext/fetch/22_body.js
AgeCommit message (Collapse)Author
2024-11-15feat(fetch): accept async iterables for body (#26882)Luca Casonato
Reland of #24623, but with a fix for `String` objects. Co-authored-by: crowlkats <crowlkats@toaxl.com>
2024-09-06fix(runtime): use more null proto objects again (#25040)Kenta Moriuchi
proceed with #23921 This PR is a preparation for https://github.com/denoland/deno_lint/pull/1307 --------- Signed-off-by: Kenta Moriuchi <moriken@kimamass.com> Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-09-04refactor(ext/fetch): align error messages (#25374)Ian Bull
Aligns the error messages in the ext/fetch folder to be in-line with the Deno style guide. https://github.com/denoland/deno/issues/25269
2024-08-26Revert "feat(fetch): accept async iterables for body" (#25207)Luca Casonato
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
2024-08-06feat(fetch): accept async iterables for body (#24623)Leo Kettmeir
Implements https://github.com/whatwg/webidl/pull/1397 Fixes #21454 Closes #24849
2024-07-31perf(ext/fetch): speed up `resp.clone()` (#24812)Luca Casonato
2024-05-23feat(ext/fetch): `Request.bytes()` and `Response.bytes()` (#23823)Asher Gomez
Closes #23790
2024-01-10refactor: use `core.ensureFastOps()` (#21888)Kenta Moriuchi
2024-01-04fix: strict type check for cross realms (#21669)Kenta Moriuchi
Deno v1.39 introduces `vm.runInNewContext`. This may cause problems when using `Object.prototype.isPrototypeOf` to check built-in types. ```js import vm from "node:vm"; const err = new Error(); const crossErr = vm.runInNewContext(`new Error()`); console.assert( !(crossErr instanceof Error) ); console.assert( Object.getPrototypeOf(err) !== Object.getPrototypeOf(crossErr) ); ``` This PR changes to check using internal slots solves them. --- current: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error {} > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) Date {} ``` this PR: ``` > import vm from "node:vm"; undefined > vm.runInNewContext(`new Error("message")`) Error: message at <anonymous>:1:1 > vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`) 2018-12-10T02:26:59.002Z ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-12-07refactor: pull 'core', 'internals', 'primordials' from ES module (#21462)Bartek Iwańczuk
This commit refactors how we access "core", "internals" and "primordials" objects coming from `deno_core`, in our internal JavaScript code. Instead of capturing them from "globalThis.__bootstrap" namespace, we import them from recently added "ext:core/mod.js" file.
2023-08-15fix(ext/fetch): clone second branch chunks in Body.clone() (#20057)Marcos Casagrande
This PR makes `Body.clone()` spec compliant: https://fetch.spec.whatwg.org/#concept-body-clone > 1, Let « out1, out2 » be the result of [teeing](https://streams.spec.whatwg.org/#readablestream-tee) body’s [stream](https://fetch.spec.whatwg.org/#concept-body-stream). > ... > To tee a [ReadableStream](https://streams.spec.whatwg.org/#readablestream) stream, return ? [ReadableStreamTee](https://streams.spec.whatwg.org/#readable-stream-tee)(stream, true). --- Closes #10994
2023-06-05chore: update deno_lint to 0.46.0 (#19372)Kenta Moriuchi
2023-05-01refactor(webidl): move prefix & context out of converters options bag (#18931)Leo Kettmeir
2023-04-28fix(ext/fetch): subview Uint8Array in Req/Resp (#18890)Luca Casonato
2023-04-02chore: Turn back on dlintPreferPrimordials (#17715)Kenta Moriuchi
Closes #17709
2023-03-08refactor: rename InternalModuleLoader to ExtModuleLoader, use ext: scheme ↵Bartek Iwańczuk
for snapshotted modules (#18041) This commit renames "deno_core::InternalModuleLoader" to "ExtModuleLoader" and changes the specifiers used by the modules loaded from this loader to "ext:". "internal:" scheme was really ambiguous and it's more characters than "ext:", which should result in slightly smaller snapshot size. Closes https://github.com/denoland/deno/issues/18020
2023-02-07 refactor: remove prefix from include_js_files & use extension name (#17683)Leo Kettmeir
2023-02-07refactor: Use ES modules for internal runtime code (#17648)Leo Kettmeir
This PR refactors all internal js files (except core) to be written as ES modules. `__bootstrap`has been mostly replaced with static imports in form in `internal:[path to file from repo root]`. To specify if files are ESM, an `esm` method has been added to `Extension`, similar to the `js` method. A new ModuleLoader called `InternalModuleLoader` has been added to enable the loading of internal specifiers, which is used in all situations except when a snapshot is only loaded, and not a new one is created from it. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-16chore: update dlint to v0.37.0 for GitHub Actions (#17295)Kenta Moriuchi
Updated third_party dlint to v0.37.0 for GitHub Actions. This PR includes following changes: * fix(prefer-primordials): Stop using array pattern assignments * fix(prefer-primordials): Stop using global intrinsics except for `SharedArrayBuffer` * feat(guard-for-in): Apply new guard-for-in rule
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-10-08fix(ext/fetch): reject immediately on aborted signal (#16190)Marcos Casagrande
Enabled the following test: https://github.com/web-platform-tests/wpt/blob/edc428e8e229429acd723efc7a6d41010c94fc41/fetch/api/abort/general.any.js#L185-L201
2022-10-04perf(ext/fetch): consume body using ops (#16038)Marcos Casagrande
This commit adds a fast path to `Request` and `Response` that make consuming request bodies much faster when using `Body#text`, `Body#arrayBuffer`, and `Body#blob`, if the body is a FastStream. Because the response bodies for `fetch` are FastStream, this speeds up consuming `fetch` response bodies significantly.
2022-09-29fix(ext/fetch): `Body#bodyUsed` for static body (#16080)Marcos Casagrande
This fixes a bug where `Body#bodyUsed` incorrectly returns `false` for a body that has actually already been consumed, after `Body#body` is called.
2022-09-26perf(ext/fetch): use content-length in InnerBody.consume (#15925)Marcos Casagrande
This fast path prevents repeated allocations when receiving a fetch body with a known size. Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-08-18feat(ext/flash): An optimized http/1.1 server (#15405)Divy Srivastava
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl> Co-authored-by: crowlkats <crowlkats@toaxl.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-07-28fix(ext/fetch): resolve TODOs about WebIDL conversions in body init (#15312)Phosra
2022-02-01refactor: primordials for instanceof (#13527)Bartek Iwańczuk
2022-01-27Revert "refactor: update runtime code for primordial checks for "instanceof" ↵Bartek Iwańczuk
(#13497)" (#13511) This reverts commit 884143218fad0e18f7553aaf079d52de703f7601.
2022-01-27refactor: update runtime code for primordial checks for "instanceof" (#13497)Bartek Iwańczuk
2022-01-07chore: update copyright to 2022 (#13306)Ryan Dahl
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2021-10-26perf(http): encode string bodies in op-layer (#12451)Aaron O'Mullan
Using serde_v8's StringOrBuffer
2021-10-07perf(fetch): fast path Uint8Array in extractBody() (#12351)Aaron O'Mullan
2021-09-26perf(fetch): optimize InnerBody constructor (#12232)Aaron O'Mullan
Avoid initializers due to overhead
2021-09-25perf(ext/fetch): Use the WebIDL conversion to DOMString rather than ↵Luis Malheiro
USVString for Response constructor (#12201)
2021-08-11Rename extensions/ directory to ext/ (#11643)Ryan Dahl