Release notes
Every release, newest first, the same text as CHANGELOG.md on GitHub and the release pages. It is read from that file when the site is built, so it is always complete.
Where to read about the 2.8 features: validating responses (Zod, Valibot, ArkType), auth, extend() and client options, paginate, dedupe, httpCache, blob, resumable downloads, testing with createMockTransport(), error type guards, examples, the API reference, supply-chain checks and the security claims, the threat model, the independent review call and Rust upload progress.
Documentation
- Crawler metadata (
#330): publishrobots.txt,sitemap.xmlandllms.txtwith the documentation site, and emit one canonical URL per page, so search engines and AI assistants can index the docs (docs/public/,docs/.vitepress/config.mts).
2.8.1 - 2026-11-13
Patch release for 2.8.x fixing per-request WebAssembly closure heap retention under deadlineMs and AbortSignal, declaring sideEffects in the npm manifest, and updating backoff/API documentation. Public APIs and defaults are unchanged.
Fixed
- Synchronous
deadlineMsandAbortSignalclosure cleanup (#327): ReplaceJsFuture-backedDelayandAbortedfutures inwasm-module/src/wasm/futures.rswith anRc<WakeState>and ownedClosure<dyn FnMut()>cleared and dropped synchronously when a future is dropped or detached, fixing per-request JavaScript heap retention when requests finish before their deadline or abort signal fires. Also eliminate duplicate nestedwith_deadlinetimer wrappers across Wasm request execution (wasm-module/src/wasm/mod.rs), verified with forced-GC 15,000-request regression tests (wasm-module/js/test/memory.test.mjs).
Changed
- Package
sideEffectsand JS glue cleanup (#327): DeclaresideEffects: ["./node.js", "./rust_fetch.js", "./snippets/*"]in the generated npmpackage.json, deduplicateoptionsArgIndex(name)across JavaScript wrapper layers intowasm-module/js/client-helpers.js, and keeprust_fetch_bg.wasmwithin the455.5 kBraw size budget (wasm-module/src/client.rs,wasm-module/src/http.rs).
Documentation
- Backoff jitter &
llms.txt(#327): Document the 50–100% retry backoff jitter inRetryOptionsTypeScript JSDoc and the timeouts/retries guide, and updatellms.txtacross the repo root and package to cover the full 2.x API, runtime modes, observability, security defaults, and Rust crate exports.
2.8.0 - 2026-11-08
Added
- Rust crate:
RequestBuilder::on_upload_progress(callback)(#24) reports the request body as the connection takes it, in pieces of up to 64 KiB, withProgress { loaded, total: Some(size) }; a retried attempt starts again from 0 and a request without a body reports nothing. The body is still sent with aContent-Length, not chunked. Native targets only (notwasm32, where requests usefetch()), so the WebAssembly module is unchanged. Interceptors and WebSockets for the crate remain open in #24. - A Windows CI job (#15,
.github/workflows/windows.yml): the package and the native addon are built with MSVC and the JavaScript suite runs against both Node.js transports on Node.js 22 and 24, weekly and on changes tonative/or the JavaScript tests. Getting it green found only test-environment differences, fixed in the tests:npm.cmdneeds a shell since Node 20.12, file URLs are not paths, OpenSSL reads backslashes in its config as escapes, line endings, and Windows refuses hundreds of simultaneous loopback connections (two tests that need more than 256 are skipped there, and the connection bursts in two others are smaller). No product code changed. - A browser example (#73,
examples/browser-upload/): a Vite page with a file input, a progress bar driven byonUploadProgress, and a cancel button.bundlers.test.mjsbuilds it unchanged with Vite 8 and drives it in Chromium: a 12 MB upload moves the bar in steps and ends full with every byte received, and a stalled upload is cancelled. With the Worker example this completes the example list in #73. - A Cloudflare Worker example (#73,
examples/cloudflare-worker/): a Worker in front of another API with retries, a timeout and errors mapped to responses, and the.wasmimported as a module. The workerd test runs this file unchanged, so it can't rot. - Documentation: Wording this project does not use in the security guide: eight phrases from outside reviews ("one of the best", "rigorous" prototype pollution protection, "true" SSRF protection, "bank-level", "zero-dependency validation", "unique", "production-proven", an unscoped "100% coverage"), why each is not said, and the sentence that is.
- A Cloudflare Workers smoke test (#48,
wasm-module/js/test/runtimes/workers.mjs): the browser entry runs insideworkerdwith the.wasmdeclared as a module, and makes GET and POST requests, rejects with a typedHttpError, retries and reads Server-Sent Events.workerdis an exact-pinned development dependency of the runtimes test package (npm audit: 0 vulnerabilities). A deployed Worker is not tested. - esbuild in the bundler tests (#71,
bundlers.test.mjs): an app is bundled to one ES module with esbuild 0.28 and runs in Chromium. esbuild does not emit the.wasm, so it is copied next to the bundle; the compatibility page says so. esbuild is a new exact-pinned development dependency. - Security release drill through a draft advisory and a temporary private fork (#234,
docs/security-release-checklist.md): timings, and what the fork cannot do (no Actions, no merge from the command line, no deletion through the API, slow to populate).scripts/bump-version.mjs X.Y.Zsets the version in all ten places a release changes and writes nothing unless every place matches. The drill advisory was closed unpublished with no CVE. A second person who can publish is still missing, so #234 stays open. - A tested recipe for channels over a WebSocket (#154,
examples/websocket-chat/channels.mjs): a client-side list of channels, routing by a channel field,subscribe/unsubscribemessages and, the part that is easy to forget, subscribing again after every reconnect. The WebSockets guide records the evaluation of a Socket.IO-compatible client (#155): not planned; usesocket.io-clientfor the live part of a Socket.IO app. - Resumable downloads (#51):
resume: true | { maxResumes }on a streamedget. When the connection breaks mid-body, the download continues withRangeandIf-Rangefrom the last byte received, up tomaxResumestimes (default 3), only for a200withAccept-Ranges: bytes, a strongETagor aLast-Modified, and noContent-Encoding, and only if the continuation is a206starting at the right byte (a changed file errors instead of splicing).response.resumescounts the continuations. Resumable uploads (tus) are not part of this. The glue grows by 3.7 kB, so its size budget rises deliberately from 132.0 to 135.5 kB. - A tested recipe for request and response over a WebSocket (#153,
examples/websocket-chat/request.mjs, linked from the WebSockets guide): ids on outgoing messages, the first reply with the same id resolves the request, and every pending request is rejected on timeout, abort, drop, close or overflow. It is a recipe rather than a built-in because the id convention and the right behaviour across a reconnect are the server's. - Bun and Deno smoke tests in CI (#48,
wasm-module/js/test/runtimes/smoke.mjs): thirteen checks (GET and POST, error kinds, retries, timeouts, cancellation with its reason, gzip, Server-Sent Events, NDJSON, upload progress,auth, a WebSocket) pass on Bun 1.4.4, Deno 2.9.6 and Node.js. The runtimes come from a locked npm manifest that Dependabot and the dependency audit cover. Cloudflare Workers are tested onworkerd(below); a deployed Worker, Vercel Edge and other edge runtimes are not, and the compatibility page says so. - An API reference on the documentation site (#72), generated by TypeDoc from the public TypeScript snapshot
api/rust-fetch.d.tson every docs build, so it can't drift from the types. TypeDoc and its markdown plugin are development dependencies ofdocs/, withminimatchoverridden to a patched version to keep the dependency audit clean. - Bundler compatibility tests (#71,
bundlers.test.mjs): a small app that imports rust-fetch is built with Vite 8 (production and dev server) and webpack 5 (production), and the build runs in Chromium and makes requests. Vite and webpack are development dependencies. Next.js, plain Rollup and SSR builds are not covered yet (esbuild is, below). - Runnable examples (#73):
examples/node-client(production client),examples/llm-streaming(SSE and NDJSON) andexamples/websocket-chat(reconnecting WebSocket), each a script and arun()function, tested in CI against local servers. The 1.x-era examples, which fetched a public placeholder API and listed unused dependencies, are removed; browser and Worker examples follow with #71 and #48. - An opt-in response cache (#45),
httpCache: true | { maxEntries, maxBytes, maxEntryBytes }: a private, in-memory cache forGETresponses following RFC 9111. Fresh responses (max-age,Expires) are served from memory; stale ones with anETagorLast-Modifiedare revalidated withIf-None-Match/If-Modified-Since, and a304serves the stored response (cachedandrevalidatedon the response).no-store,no-cache,Varyand request cache directives are honoured, successful writes invalidate their URL, and it is bounded by entries and bytes. NamedhttpCachebecausecachealready sets the browser's fetch cache mode. The glue grows by 8.8 kB raw (2.2 kB gzip), so its size budget rises deliberately from 123.0 to 132.0 kB. - Documentation: Compared with Socket.IO in the WebSockets guide, with a comparison table, when
websocket()is enough, and a decision table, checked against the Socket.IO v4 documentation (#152). A FAQ entry links to it. responseType: 'blob'(#81): the response body as aBlobtyped with the response'sContent-Type, for object URLs, image previews and saving files. Built from the binary body, so download progress works; an empty body gives an emptyBlob. The glue grows by 1.3 kB, so its size budget rises deliberately from 121.7 to 123.0 kB.- A
dedupeoption (#46), on the client or on oneget/headrequest: identical requests in flight at once share one request. Each caller gets its own response and its own copy of the body; an error reaches every caller; cancelling one caller leaves the others, and the request is cancelled when all have cancelled. Off by default; writes, streamed responses and requests with callbacks are never shared. The glue grows by 4.3 kB, so its size budget rises deliberately from 117.5 to 121.7 kB. - A
schemarequest option (#43): validate the response body with any Standard Schema (Zod, Valibot, ArkType…); the body becomes the schema's output, typed as such. A body that fails rejects with a newValidationErrorkind (withissues,status,method,url, and the guardisValidationError), which is not retried and only appears whenschemais used. Its message counts the issues without quoting values. No validator is a dependency; Zod and Valibot are dev dependencies of the tests. The glue grows by 2.6 kB, so its size budget rises deliberately from 114.8 to 117.5 kB. client.paginate(url, options)(#44): an async iterator over the pages of a paginated API, or its items withitems. It follows theLinkheader'srel="next"by default, or the cursor yournextfunction returns;maxPages(default 1000),breakandsignalstop it. A next URL on another origin throws anInvalidInputErrorunlesscrossOrigin: true. The glue grows by 2.4 kB, so its size budget rises deliberately from 112.5 to 114.8 kB.- An
authclient option (#70):bearer(a token, or a sync or async function called for each request) orbasiccredentials, sent only to the origin ofbaseUrland the origins inauth.origins(a client needs one of them), never to another origin. Withrefresh, concurrent401responses trigger one refresh (single flight) and each failed request is replayed once; a second401rejects with theHttpError, and a failed refresh rejects it with the failure ascause. The glue grows by 4.8 kB, so its size budget rises deliberately from 107.5 to 112.5 kB. - A
transportclient option andcreateMockTransport()(#47), imported from the newrust-fetch/testingentry so it stays out of production bundles, for unit tests: requests are answered by routes you write (on(method, path | RegExp | fn, response | fn),onAny,calls,reset), while the real retry, timeout, cancellation, error and decoding behaviour runs. The option is read from the client only: a request option on a plain object or a pollutedObject.prototypecan't set it. Streamed responses,events()andwebsocket()are not covered. The Wasm module grows by about 0.4 kB and the glue by 1.3 kB; both size budgets rise deliberately. client.extend(overrides)(#69): a derived client with the parent's options and interceptors and the overrides on top. Headers are merged by name; other options are replaced. Circuit breakers, rate limits, concurrency limits, retry budgets and metrics are not shared. Written in JavaScript, so the Wasm module does not grow; the glue grows by 2.7 kB, so its size budget rises deliberately from 103.2 to 106.2 kB.- Type guards for errors (#68):
isRustFetchError(value, kind?)andisHttpError,isTimeoutError,isNetworkError,isParseError,isInvalidInputError,isCancelledError,isCircuitOpenError,isJsInteropError, with TypeScript types that narrowcatch (error)to the fields of that kind (RustFetchHttpErrorhasstatusandstatusText, and so on;RustFetchErrorOf<K>). They check the error's shape instead ofinstanceof, so an error from another realm or a second copy of the package is recognised. The JavaScript glue grows by 1.2 kB, so its size budget rises deliberately from 102.0 to 103.2 kB. CancelledErrorcarries the abort signal's reason asreasonand as the standardcause(#80), for requests, retry delays andstream/ndjsonresponse bodies: aTimeoutErrorDOMExceptionforAbortSignal.timeout(), anAbortErrorforabort(), or whatever you passed toabort(reason).kindandnameare unchanged. It is also on theopenedrejection ofevents()andwebsocket()when the signal aborts first. The Wasm module grows by about 1.2 kB raw, so its size budget rises deliberately from 453.5 to 455.0 kB.
Changed
- CI and the release build the Wasm package through
scripts/ci-build-wasm.sh, which retries only when wasm-pack fails to download one of its tools (wasm-opt's binaryen comes from GitHub releases, which returned HTTP 5xx for hours on 2026-11-08). Any other failure stops at once, and the build that succeeds is the same build, so the published Wasm is unchanged. - The JavaScript coverage gate (
npm run coverage:js) now also coversrust-fetch/testing(createMockTransport) at 100% of lines and functions, with its test in the gated set. The option layers in the glue (auth,schema,dedupe,httpCacheand the rest) are tested but not gated: the generated WebAssembly glue shares the file, and gating it at 100% is not possible. - The built
wasm-module/pkg/rust_fetch_bg.wasmis no longer committed (#232, OpenSSF Scorecard Binary-Artifacts). The repository holds only the source;npm run buildproduces the module, and CI, the release and the reproducibility check already built it. After cloning, runnpm run buildbefore the JavaScript tests. - Rust dependencies updated within their ranges (39 packages across the Wasm module and the native addon), including wasm-bindgen 0.2.130,
aws-lc-rs1.19.0 andaws-lc-sys0.47.0. The Wasm module grows to 453.2 kB raw (+1.8%) and the JavaScript glue to 101.7 kB, so their size budgets rise deliberately.wasm-streamsstays at 0.5:reqwest0.13.5 depends on it, and a second version fails the Wasm link.
Fixed
- Bundle size figures in the README, the FAQ, the introduction, the compatibility page and
llms.txtwere out of date (121 KB for the WebAssembly module and 131 KB in all): the module is about 148 KB brotli-compressed and the whole browser entry about 171 KB, before a bundler minifies the glue. They are the numbersnpm run sizechecks. - Errors no longer carry the URL password or fragment (#238, #239).
http://user:secret@host/p?q=1#fnow appears inerror.urlashttp://user:***@host/p?q=1, on the error and on every error in itscausechain, on the Node.js transports and the native addon. Before, the raw URL stayed onerror.cause.url, andredactUrlwas not applied there.redactUrlnow covers the wholecausechain. The glue size budget grew by 0.6 kB for it. - node:http TLS policy matches the native addon (#244): a certificate without a
subjectAltNameis now refused on thenode:httptransport (Node otherwise falls back to the subject common name, which browsers and rustls do not), and connections use OpenSSL security level 2, so RSA keys below 2048 bits, SHA-1 signatures and DH below 2048 bits are refused on every supported Node version (before Node 24 the default level allowed RSA 1024). Node glue grows to 60.3 kB raw (gzip 19.3, brotli 16.8); its budget rises deliberately from 59.8/19.2/16.8 to 60.5/19.4/16.95 kB. baseUrlwith a query or fragment (https://api.example.com/v1?x=1) is now refused with anInvalidInputError(parameter: 'baseUrl'). A path appended after one became part of it, soget('users')requested/v1?x=1/users, which is the base path itself, not/v1/users.baseUrlis also kept in its parsed form, so surrounding spaces, tabs or newlines, an upper-case host and a default port no longer reach the request path (" https://api.example.com/v1 "requested/v1%20/users). The origin was never affected. Found by the new URL differential check (#217).
Security
- OpenSSF Scorecard findings (#232):
release.ymlno longer grantscontents: writeto the whole workflow, only to its one job; the two fuzzing Dockerfiles pin their base image by digest, and Dependabot now updates those digests; each release attaches the published npm tarball and its Sigstore signature (rust-fetch-X.Y.Z.tgz.sigstore.json, verify withcosign verify-blob) to the GitHub release. - The release checklist says how a second person gets the ability to ship a security fix (#234): Write access and a tag ruleset, because a tag push runs
release.yml, plus a rehearsal. No second person has been named yet. - OpenSSF Scorecard (#232,
.github/workflows/scorecard.yml): weekly and on pushes to main, uploaded to code scanning and published to the public Scorecard API, which the README badge reads. - Memory-safety CI (#230,
.github/workflows/memory-safety.yml): Miri on the unit tests of the pure Rust modules and AddressSanitizer on the whole host test suite, on pull requests that touch the Rust source and weekly. The native addon is built with AddressSanitizer in a third job and run through the JavaScript tests that use it (#223). - Strict-CSP browser test (#233,
browser-csp.test.mjs): the browser build loads and makes requests in Chromium, Firefox and WebKit underscript-src 'self' 'wasm-unsafe-eval'with Trusted Types required, and any policy violation fails the test. - An open call for an independent security review (#223,
docs/security-review.md): the six areas to review, what the project provides, how to report privately, and a status table. It says plainly that CI, fuzzing and AI-assisted review are not an independent review. - A failing reproducibility check now blocks a release (#232):
release.ymlrunsscripts/check-wasm-reproducible.shbefore publishing, which builds the tagged source twice in different directories and fails unless both builds and the Wasm about to be published are identical. The pull-request check uses the same script. - ClusterFuzzLite fuzzes the six parser targets with the address sanitizer on pull requests (#231,
.github/workflows/clusterfuzzlite.yml), and reports a crash as a code scanning alert visible only to people with access to the security tab, not as a public artifact. - Hostile and malformed server responses are now in the conformance matrix on every adapter, browsers included (#228): twelve raw responses (conflicting or doubled
Content-Length,Transfer-Encoding, bad chunks, bare LF, line folding, a space before the colon, text that is not HTTP, an unknown HTTP version, a short body, bytes after the declared length), with each difference between adapters explained inCONFORMANCE.md. - Release drill (#234): a dry run of the security release procedure was done (fake report, fix, backport, version bump, CI, pre-publish check), with timings and the problems found in
docs/security-release-checklist.md, and the page's state table is brought up to date (private vulnerability reporting, themainruleset and push protection are on). - The secret-leak canary test now also runs on node:http (
secret-canary-js.test.mjs), anddocs/security.mdlists where a credential may and may not appear (#227). - The SSRF range test and the redirect credentials test now run on both Node transports, the native addon and node:http (
ssrf-ranges-js.test.mjs,redirect-credentials-js.test.mjs) (#225, #226). - Four new fuzz targets for the Node.js transport (#231,
scripts/fuzz-node-boundary.mjs, run in the fuzz workflow with seeds underwasm-module/fuzz/corpus/node-*): theproxyoption andNO_PROXY, redirectLocation,Content-Typeand decompression undermaxResponseBytes. A scheduled fuzzing failure now tells the reader to report a possible vulnerability privately before posting the reproducer. - Fuzzing keeps its corpus between scheduled runs (#231) and
wasm-module/fuzz/oss-fuzz/holds the files for an OSS-Fuzz application, which has not been submitted. - Reproducible-build check (#232,
.github/workflows/reproducible.yml): on every pull request that touches the Rust source, the Wasm is built twice in two directories with the pinned toolchain (Rust 1.99.1, wasm-pack 0.15.0) and the SHA-256 ofrust_fetch_bg.wasmmust match. Weekly, the latest release is rebuilt from its tag and compared with the tarball on npm. - Differential check of URL resolution against the WHATWG URL parser (
scripts/fuzz-url-differential.mjs), run with the scheduled fuzzing workflow. The decided differences are listed indocs/security.md(#217). allowPrivateNetwork: falsenow also blocks the IPv6 benchmarking block2001:2::/48(RFC 5180) and the deprecated ORCHID block2001:10::/28, which the IANA IPv6 special-purpose registry lists as not globally reachable. They are not routed on the public internet, so the exposure was small. A new test takes every not-globally-reachable block from the IANA IPv4 and IPv6 registries and checks its first, middle and last address and its neighbours, and a controlled resolver checks mixed public and private answers and repeated lookups (#225).- Secret-leak canary test: unique strings in the URL (user, password, query, fragment), headers, a proxy password and the body are sent through nine failing scenarios (refused, server error, redirect, timeout, retries exhausted, proxy refused, response too large, blocked address, cancelled), and everything the application can observe is searched for them. Debug entries, lifecycle hooks,
stats()and console output are clean in every scenario, and so are errors for headers, the proxy password and the body. The test first found two gaps, recorded as expected failures and fixed in this release: error objects carried the URL password and fragment (#238), andredactUrlwas not applied toerror.cause.url(#239). Part of #227. - Hostile-response test: a raw TCP server sends malformed framing (conflicting or duplicate
Content-Length,Content-LengthwithTransfer-Encoding, bad or oversized chunks, trailers and headers, bare LF, folded headers, garbage), a second response on a kept-alive connection, slow headers, an endless run of103responses, a trickled body and a hugeContent-Length. Run against both the native addon and node:http. All are rejected or bounded; on the native addonContent-LengthwithTransfer-Encodingis read as chunked and the connection is closed afterwards (#243). Part of #228. - Both crates now
deny(unsafe_code). The onlyunsafeleft is the 7 keywords of the Wasm allocator, listed with their invariants indocs/unsafe.md;scripts/check-unsafe.mjsruns in CI and fails on any other. A Wasm build with theatomicstarget feature no longer compiles, because the allocator'sSyncimpl assumes one thread. Part of #230.
Tests
- Redirect and credential handling is now checked against the WHATWG definition of origin (#226): 90 spellings of same-origin and cross-origin
Locationvalues across 301, 302, 303, 307 and 308, the method and body rules for every status, refused schemes and redirect loops. No defect found. - TLS verification matrix (#229): real certificates generated with openssl, 22 cases on node:http and the native addon (expired, not yet valid, wrong name, IP address match and mismatch, self-signed, unknown root, missing intermediate, client-auth-only, issued by a non-CA, SHA-1, TLS 1.0 to 1.3), plus ALPN, SNI for IP addresses,
NODE_EXTRA_CA_CERTS,NODE_TLS_REJECT_UNAUTHORIZED=0and an HTTPCONNECTproxy. The native addon refuses every bad case. node:http accepted a certificate with the name only in the subject and a 1024 bit RSA key (#244, fixed in this release).
Documentation
- Threat model (#222):
docs/threat-model.mdstates the assets, six kinds of attacker, the trust boundary of each of the six adapters, 16 threats with the protection and the residual risk of each, and the non-goals.claims.test.mjsfails if a security claim is missing from it. Not yet reviewed by anyone else (#223). - Security claims audit (#224):
docs/security.mdnow has a table of 29 claims, each with the test that checks it or a status saying why not (tested, partial, process, stated).claims.test.mjsfails when a named test disappears. New test that importing the Node.js entry makes no outbound network call. Reworded: "Safe with servers and URLs you don't control" is now "Guards against ...", "Only rust-fetch blocks SSRF" names the three clients and versions compared, and the SECURITY.md lines on observability redaction and native adapter isolation state what is and is not tested (#238, #239).
2.7.2 - 2026-11-06
Security-first patch for 2.7.x: fewer panics in the Wasm core and stronger automated checks on dependencies, workflows and parsers. Public APIs and defaults are unchanged.
Security
- Remove
unwrap/expectcalls that untrusted or caller-supplied input could reach: acircuitBreakerorrateLimitoption that cannot be converted now rejects with anInvalidInputError, and per-origin limiting no longer assumes a URL shape. Library code now deniesclippy::unwrap_usedandclippy::expect_used(checked in CI for native andwasm32); the remaining invariants are annotated with the reason they cannot fail (#216). - Fix the scheduled fuzzing failure (#207): the URL fuzz target joined arbitrary
file:bases, which panics inside theurlcrate (servo/rust-url#1114). The client only accepts http(s) bases, so the library was not affected; the target now exercises the client's own resolution, with a regression test and corpus seed (#213).
Changed
- Repository checks, not part of the npm package: a weekly dependency advisory audit (#214), CodeQL code scanning and zizmor workflow lint (#215). The release workflow no longer uses a build cache, workflow checkouts no longer persist credentials, and Dependabot waits seven days before proposing new versions.
2.7.1 - 2026-11-03
Security hardening and performance fixes for 2.7.0. Public APIs and defaults are unchanged. The native transport remains an optional local build, outside the npm package.
Security
- Use prototype-free property descriptors for URL request preparation, browser stream sources and idempotency-key snapshots. Inherited
get/setfields cannot inject accessor semantics or make those descriptors reject requests. Preserve real__proto__response headers and inherited-name collisions without invoking prototype getters/setters.
Changed
- Keep optional body and browser transport futures out of ordinary Node requests. Buffered JavaScript requests also bypass diagnostics instrumentation when it is disabled (#180).
- Reduce native request conversion work with a compact common entry and worker-prepared default headers. Requests with optional policies retain the full path. Both paths preserve TLS scopes, synchronous cancellation registration and request-generation checks (#181).
- Complete native request-ID cleanup on the owning JavaScript thread before promise resolution; keep TCP/TLS handshake state off reused connections. Rebuild local addons for private wire version 6; older binaries fall back to node:http.
- Compare CI with both historical 2.6.1 and security-patched 2.6.2, including rebuilt native transport assets. Keep the original benchmark thresholds and security checks.
Performance and remaining limitations
A pre-release CI benchmark versus published 2.7.0 measured node:http concurrent throughput 1.6% higher, startup 3.4% faster and default client overhead 0.9% better. Against 2.6.1, the same run measured:
| Metric | Change versus 2.6.1 |
|---|---|
| Default client overhead | Essentially level |
| Node:http concurrent throughput | 9.9% slower |
| Native concurrent throughput | 4.7% faster |
| Node:http import + first request | 4.6% slower |
| Native import + first request | 12.8% slower |
These are per-run medians, not guarantees. Shared-runner results varied substantially; an independent fifteen-round balanced native comparison measured 0.9% below 2.6.1. The larger 2.7 Wasm/JavaScript assets remain, and performance parity with 2.6.1 is not complete. The published Node transport's throughput gap is close to the unchanged 10% release threshold. Method, raw samples, CI links and less favorable runs.
2.7.0 - 2026-11-02
Resilience, observability and a streaming upload path. Everything new is opt-in: per-request retry policies, idempotency keys for POST and PATCH retries, concurrency and rate limits, per-origin circuit breakers, connect, response, idle and total timeouts, streaming request bodies, request timings, lifecycle hooks, redacted debug logs and W3C trace context, and client.stats(). Errors now carry the method, URL and attempts. The native transport gets per-module isolation of its TLS settings and cancellation scope; it is still not in the npm package. Performance: measured against 2.6.1, per-request overhead is about 0–4% higher and node:http startup 5–10% slower on CI (the release gate's limit is 10%, so the margin is thin; #180), the WebAssembly module grows from 381 to 439 kB (122 to 146 kB brotli), and native-transport concurrency is about 10% lower than 2.6.1 (#181). The "no measurable overhead when unset" goals of the new features are not met; the costs are listed under Changed. Prototype pollution of the Node.js and browser request paths is closed across the client (#191; see Security).
Added
- JavaScript observability: opt-in request/attempt timings, isolated lifecycle hooks, redacted structured debug logs (
debugor Node'sDEBUG=rust-fetch), and W3C trace context with an explicit origin allowlist. Automatic trace headers are removed on cross-origin Node/native redirects; browser tracing refuses redirects.stats()exposes bounded client latency/count metrics and Node pool snapshots. Stream lifecycles finish on EOF/error/cancellation. Request and connection errors carry method, destination and attempt context; observed errors retain underlying JavaScript causes where available (#42, #65, #66, #113). - Reliability and fuzzing: deterministic loopback fault cases across all six conformance adapters, a reproducible comparison with fetch, undici, axios, ky and got, six offline parser fuzz targets, and deterministic JS/Wasm boundary fuzzing. Scheduled and PR smoke workflows retain crash artifacts; scheduled failures open a deduplicated issue (#67, #157).
- WebSocket idle timeout: opt-in
idleTimeoutMsinherits the client's setting and resets on received messages. Silent peers produceTimeoutErrorwithphase: 'idle'and follow the configured reconnect policy without sending heartbeat messages. - Streaming request bodies: JavaScript
ReadableStream, async iterables and NodeReadableuploads with backpressure, bounded chunks and cancellation in node:http, the real native addon and supported browser fetch implementations (Chromium and macOS WebKit; Firefox and Linux WebKit remain unsupported). One-shot bodies disable retries; a factory supplies a fresh source for each attempt and Node body-preserving redirect. SSE reconnects require factories. Streaming progress counts transport-consumed bytes, withtotal: 0for unknown size (#112). - Phase timeouts and total deadlines: opt-in
connectTimeoutMs(Node/native Rust),responseTimeoutMs,idleTimeoutMsanddeadlineMs, on clients, requests and SSE.TimeoutError.phaseidentifiesconnect,response,idleortotal. Deadlines include interceptors, body preparation, queues and retry/reconnection delays, and proactively close unread streams and release concurrency slots.timeoutMskeeps its per-attempt behavior. Rust:PhaseTimeoutsandError::timeout_details(), preserving the error enum. Browser response/idle options select fetch for uploads and report upload progress once (#79). - Per-origin circuit breakers: opt-in
circuitBreaker: { failureThreshold, resetAfterMs }stops attempts after consecutive network errors, timeouts or 5xx, fails fast withCircuitOpenError(origin,retryAfterMs), and allows one recovery probe. Retries count as attempts; callbacks receive state transitions throughonCircuitChange. Rust builders expose the same policy, with circuit details throughError::circuit_open()rather than a new enum variant. The TypeScript error-kind union gainsCircuitOpenError, so exhaustive switches need a new case. The feature adds about 3.5 kB brotli to WebAssembly; its brotli budget rises from 133 to 137 kB. - Concurrency and rate limits: opt-in
maxConcurrent,rateLimit: { requests, perMs }andlimitsPerOrigin. Attempts queue FIFO in the shared Rust core; cancellation removes queued calls, attempt timeouts start on admission, retries re-enter the queue, and429 Retry-Afterpauses the bucket. Streamed responses and SSE hold their concurrency slot until EOF/error/cancellation. Rust:ClientBuilder::max_concurrent(),rate_limit(RateLimit::new(…))andlimits_per_origin(). - Idempotency keys:
idempotencyKey: truegenerates one UUID per call and reuses it on retries; a string supplies an explicit key. Available per request and as a client default, withfalseper call to opt out andidempotencyHeaderfor API-specific header names. A key permits POST/PATCH retries under the configured policy withoutretryNonIdempotent; server support for deduplication is required. Works with progress, streaming and SSE (same key across reconnects). Rust:RequestBuilder::idempotency_key()andidempotency_key_header()for explicit keys. - Per-request retry policies (
retriesinRequestOptionsandEventStreamOptions): a retry count orRetryOptionsobject replaces the client's policy for one call, including streamed responses, progress requests and SSE connection attempts.0disables retries; omitted object fields use standard defaults, rather than merging client values.null/undefinedinherit the client policy. The client's retry budget still applies, and SSEreconnectremains independent. Rust:RequestBuilder::retry_config()andRequestBuilder::no_retries().
Security
- Prototype pollution (#191). With
Object.prototypepolluted by other code in the process, the client read internal and documented settings from the prototype chain. On the Node.js transports an inheritedproxy(2.4.0 and later) sent requests,Authorizationheaders and bodies to an attacker's server; an inherited undicidispatcherdid the same forwebsocket()connections (2.2.0 and later); an inheritedcamade an attacker's certificate authority trusted for HTTPS (every 2.x release); inheritedbody,signal,authorpathaltered or aborted requests (an inheritedbodyalso reached requests whose request interceptor returned a new object); an inheritedtype,sizeorstartmade calls that return a stream (responseType: 'stream'or'ndjson') throw, on Node.js as an uncaught exception in a response handler, and in browsers too (every 2.x release); in browsers, inheritedcredentials,mode,cache,redirect,referrer,referrerPolicy,priority,bodyandheaders(the members of thefetch()init object) changed the requests the browser entry made (every 2.x release); inheritedblockPrivateNetwork,maxResponseBytesand timeout fields made requests fail (2.5.0 and later); and inherited streaming-upload state, in this release's new upload code, threw outside a request and ended the process. In 2.0.0 and earlier, Node.js requests went through Node's built-infetch(), which readsmethod,headers,body,signalanddispatcherfrom the prototype chain itself. Fixed throughout: the Wasm core's transport request,RequestInit, WebSocket init and native request/response objects, the node:http adapter's per-request state, upload records and diagnostics state have no prototype; plain option objects, including nested retry, circuit-breaker, rate-limit, WebSocket and SSE options, ignore inherited names (objects with their own prototype still inherit); every option Node'shttp,netandtlsread by inheritance is set explicitly, with the URL passed as options; andwebsocket()always passes undici an init object without a prototype. Node.js's own modules still read a few names themselves (an event namedtimeout, thesignalstream option); see Security. The same fix is released for each earlier 2.x line (2.1.2, 2.2.1, 2.3.1, 2.4.2, 2.5.3, 2.6.2); 2.0.0 and earlier can't be fixed inside the package (see the security guide). allowPrivateNetwork: falsethrough a proxy fails closed. A proxy resolves host names itself, so the address it connects to could not be checked and names were sent through unchecked. A host name (including after a redirect) is now refused with aNetworkErrorbefore anything is sent, while IP-address targets are checked as before; bypass the proxy for the host (NO_PROXY) or use an address. TheallowPrivateNetworkdocumentation in the TypeScript definitions says so (a comment change only; the API snapshot is updated). The check also covers more IPv6 forms: IPv4-compatible, IPv4-translated, 6to4 and Teredo addresses that carry a private IPv4 address, and the site-local, local-use NAT64,3fff::/20documentation and segment-routing ranges.- Size budgets for the hardening: the Node glue grows from 51 to 57.9 kB raw (gzip 16.5 → 18.5, brotli 14.5 → 16.1) and the shared JavaScript glue from 98.5 to 99.8 kB (gzip 19.5 → 19.6, brotli 17 → 16.9). Budgets rise deliberately to 58/18.6/16.2 and 100/19.7/17 kB; the Wasm module stays within its existing budget.
Fixed
- Header ownership across streaming and XHR: response and interceptor header objects retain actual
__proto__fields as own data properties, bypass inherited setters and read-only properties, and never join inherited values. Node's keep-alive agent uses the same privately parsed response map (#188). - Development dependency audit: update the locked
follow-redirectsused by axios comparisons to 1.16.2, addressing GHSA-mrwp-f3q8-3g9p. The published package still has no runtime npm dependencies. - Diagnostic option validation: SSE and WebSocket diagnostics preserve inherited options, including destination and private-network restrictions. Invalid lifecycle callbacks still reject before connecting; valid callbacks inherited from frozen defaults are wrapped without changing the caller's options. An own
__proto__option is copied as data and cannot replace inherited request or connection security settings. - Diagnostic header redaction: array-of-pairs headers now redact credentials by header name, matching objects,
HeadersandMap, for client defaults and both per-request header arguments. InheritedsensitiveHeadersare honored. Malformed headers or sensitive-header names cannot interrupt debug formatting or leave metrics active. Invalid header entries such as[null]reject withInvalidInputErrorinstead of leaving a request pending. - Diagnostic error handling: underlying JavaScript network causes are preserved with diagnostics disabled as well as enabled. Causes and saved destinations are cleared between retry attempts, so a later failure cannot report an earlier redirect's URL. Instrumentation preserves frozen application errors. Retry logs include the failure reason, HTTP status and server
Retry-Afterindependently of the capped wait. The ordinary JavaScript request path reuses its owned URL and existing fallback context to avoid two redundant URL copies. - Bounded native origin cache: idle origin entries are capped at 256 during admission/cleanup; active requests retain their origin's semaphore and connection pool (#119).
- Native worker/module isolation: each adapter configuration now owns its TLS settings, connection pool and cancellation scope. Each Wasm instance binds its Node adapter and WebSocket guard during initialization, so later package imports cannot select another copy's TLS policy before the first client is constructed. An insecure scope could previously disable verification in a later secure scope; identical request IDs could cancel another environment's request. Occupied IDs are rejected, late completions cannot unregister a replacement, and worker exit aborts pending requests even without a timeout. Older local addons fall back until rebuilt (private wire version 4).
- Response header prototype safety: Node reads raw header pairs into a private map, so inherited framing, encodings, MIME types and redirect locations cannot change a response. Actual
__proto__headers are retained as data. Partial buffered-body fallback includes only initialized bytes. - Bounded Rust transport variants: at most 32 alternative reqwest pools are retained for per-request connect timeouts and redirect settings; active requests keep their own client handles.
- Cancellation closes an unfinished HTTPS proxy CONNECT, including when a connect timeout fires before the outer request receives a socket.
- Native cancellation is registered before scheduling the async attempt. An immediate cancel could previously run before registration and be lost; all 512 attempts in a reproduction completed despite cancellation. New adapters check the native wire version and fall back to node:http until an older local binary is rebuilt.
- Streamed fetch responses retain their abort controller until EOF. Deadlines and cancellation now close the underlying network request in Firefox as well as Chromium and WebKit.
- Long and fractional JS timers no longer fire early. Long waits chain timers at the runtime's maximum delay; fractional milliseconds round up. Interval timing uses a monotonic clock where available.
Changed
- Native transport request conversion: uncommon timing, diagnostics and streaming-upload fields travel in one optional object. Ordinary requests avoid eight individual optional field conversions. Lowercase native response headers are built directly with own data properties, retaining prototype safety without changing the object's prototype. Rebuild local addons for private wire version 5 (#181). Measured with 50 concurrent small requests on the native transport: 28.4k → 30.3k req/s locally (2.6.1: 33.7k, so about 10% below it, down from 16%); +15.5% against the previous
mainon CI. The npm package has no native addon, so this does not affect the release gate. - Lower request overhead, faster client construction and a smaller module (#179, #180). A release audit measured the 2.7 changes against 2.6.1 rather than PR by PR: per-request client overhead was about 11% higher and node:http startup (import + first request) about 12% slower, failing the release workflow's benchmark gate. Fixes: the request's WebAssembly futures are boxed once instead of being copied through the deadline, error-context and promise wrappers; optional attempt, response and total timeouts use one future type with or without a timer; the core is built with
opt-level = "s"and one codegen unit (the size-optimized profile kept the request futures out of line and slow), withwasm-optcapping single-caller inlining so the first request compiles less code;WasmClientreads its options through one view, so absent options on plain objects cost no JavaScript call, and the rarely used ones are parsed by a function that is compiled only when one is set. Against 2.6.1 on one machine (Apple M1 Pro, Node.js 22, medians of interleaved fresh processes): per-request overhead +3.7% (was +11–12%), import + first request +5.7–7.7% on node:http (was +8.6–12.5%). On CI's Linux runners the same comparison measured overhead between +0.0% and +3.1% and startup between +5.2% and +9.7% slower across four runs, so startup still sits close to the gate's 10% threshold (#180). The WebAssembly module shrinks from 496/199/160 to 439/179/146 kB (raw/gzip/brotli); its budget is lowered to 445/181/148 kB. Native-transport concurrency remains below 2.6.1 (#181). - Plain client options ignore names inherited from
Object.prototype, as request options already do. Options objects with their own prototype (for example shared defaults) still inherit. - No failing
require()for an absent native addon. The Node.js entry checks for the bundled addon with a file stat (the npm package has none), andRUST_FETCH_NATIVE=0skips the module lookup, saving about 0.3–0.4 ms per import. - Repeated response headers on node:http are joined with
", ", as on the native transport and infetch(), since the raw-header parsing in this release. Previously node:http kept only the first value of headers such asContent-Type,LocationandRetry-After; a response that repeatsContent-Typeis no longer parsed as JSON. - CI and releases pin wasm-pack 0.15.0. The release workflow rebuilds the package, and an unpinned
wasm-pack@latestcould changewasm-optand so the published WebAssembly. With Rust 1.99.1, wasm-pack 0.13.1 and 0.15.0 produce byte-identical modules. - Ordinary JavaScript clients skip full diagnostics configuration and request instrumentation until needed. Explicit diagnostic options retain their validation,
DEBUG=rust-fetchis captured at construction, and a laterstats()call still enables collection. - Observability size budgets: with CI's Rust 1.99.1, the Wasm module is about 496/199/160 kB (raw/gzip/brotli), the shared JavaScript glue 98/19/16 kB, and Node glue 50/16/14 kB. Budgets rise deliberately to 500/200/162, 98.5/19.5/17 and 51/16.5/14.5 kB respectively. (The WebAssembly budget is lowered again above.) Header redaction and connection-option validation add about 0.7 kB of raw JavaScript; compressed budgets are unchanged by those fixes. Collection remains opt-in; the instrumentation code ships in the existing bundle.
- Upload size budgets: streaming byte plumbing adds roughly 2 kB brotli to the shared JavaScript glue and 0.6 kB to the Node adapter, plus about 2 kB to Wasm. Budgets rise to 80/14.5/12.5 kB (raw/gzip/brotli) for the glue and 46/15/13 kB for Node; the Wasm budget stays unchanged.
- Pending JS requests hold their Rust future once. The promise adapter avoids retaining a second copy, keeping default requests below the existing 4.5 KiB memory budget with the new timeout policies.
- Phase timeout size budgets: WebAssembly grows from 134 to about 154 kB brotli; the Node wrapper adds about 1 kB. Budgets rise deliberately to 480/192/156 kB (raw/gzip/brotli) for Wasm and 43/14/12.5 kB for Node.
Documentation
- Documentation by version. The site has a version menu with minor-version labels: the latest release (2.7), archived 2.6 documentation with its own sidebar and navigation, and 2.5 documentation (the README as published with 2.5.2). Search covers the latest version only.
2.6.1 - 2026-10-29
A maintenance release with no changes to the client's code. The package now includes its contribution guide, code of conduct and security policy, and llms.txt links to the documentation site instead of README sections that moved there. The documentation site was reviewed against the code. The native transport, which isn't in the npm package yet, gets a zstd update that fixes three advisories.
Security
- The native transport's zstd decoder is updated to 0.14 (zstd-safe 8.2.0), fixing RUSTSEC-2026-0391 (data from an abandoned stream leaking into the next on a reused context), RUSTSEC-2026-0398 (
Seekable::decompresssetting aVeclength beyond its capacity) and RUSTSEC-2026-0403 (uninitialized memory exposed when streaming decompression of a legacy frame fails). They affect the optional native addon only, not the WebAssembly build, thenode:httptransport or browsers. Decompression limits are unchanged (#160).
Documentation
- Added a community code of conduct and issue forms, linked from the README and contribution guide. npm packages now include the contribution guide, code of conduct, and security policy. Dependabot covers the native crate and all JavaScript projects, and CI audits their lockfiles for known vulnerabilities.
- A clearer path through the guide.
/guide/is now a Guide overview page (it was a 404) with a reading order and every client method and the most-used client and request options on one page. Getting started adds a recommended production client, interceptors, a Server-Sent Events stream and a WebSocket. The performance page opens with a short summary, and the guide's sidebar is grouped into Basics, Reliability, Streaming and real-time, and Tooling. - A review of the documentation site against the code. The client options page lists all 16 options with their defaults (it had 8, none of 2.6's), and the request,
events()andwebsocket()option tables gain the per-request and per-stream security and size options. The errors page lists the limit fields aNetworkErrorcarries andretryBudgetExhausted. Corrected: the conformance count on the architecture page (52, not 47); when the native transport steps aside (also forproxyandallowPrivateNetwork: false); WebSockets are tested on Node.js 20 too; Deno and Bun were described asfetch()runtimes, which they aren't for this package (Bun loads its Node.js entry, and neither is tested); the performance summary now says it was measured with 2.1.x.llms.txt, which ships in the package, linked README sections that moved to the site.
2.6.0 - 2026-10-25
Limits for load and for servers you don't control, and credential-safe redirects. Every new limit is opt-in except the automatic backpressure on client.events(): maxPendingRequests sheds load beyond a pending-request limit, retryBudget caps the retries a failing upstream causes, maxLineBytes and maxEventBytes bound streamed lines and events, and maxQueuedMessages and maxQueuedBytes bound a WebSocket's send queue. sensitiveHeaders drops custom credential headers on cross-origin redirects, allowInsecureRedirects: false refuses redirects from https: to http:, and allowPrivateNetwork: false now covers websocket(). On Node.js 20 and 22, a burst of cancelled requests can no longer abort the process through a V8 bug that 2.5.2 hits too (#148). A pending request uses 45% less WebAssembly memory and the browser bundle is 31% smaller. Documentation moved to asemqaffaf.github.io/rust-fetch. Performance: the packed package was benchmarked against 2.5.2 from npm, with no slowdown detected. Comparisons against fetch() and axios were not rerun, so the comparative results in the documentation remain tied to the versions they tested.
Added
- A transport conformance suite (
npm run test:conformance): 52 behaviours (redirects, decompression, size limits, timeouts and cancellation, errors, streaming, security checks) run with the same test code on node:http, the native addon,fetch()in Node.js, Chromium, Firefox and WebKit. Every difference between them is either documented with its reason or fails CI, and CONFORMANCE.md shows the matrix (#109). maxEventBytes: a limit on one Server-Sent Event's data.maxLineByteslimits each line, but an event made of manydata:lines was assembled in memory without limit until its blank line, withonEventtoo. WithmaxEventBytes, adata:line that would take the event's data (its lines joined with\n) over the limit is refused before it's buffered; the events before it are delivered, then the stream errors with aNetworkErrorwhosemaxEventBytesis the limit, and isn't reconnected. Client option, or perevents()stream (nullfor none). This completes #121.allowPrivateNetwork: falsenow coverswebsocket(). Node's built-in WebSocket connects through undici, notnode:http, so it wasn't checked: a server opening WebSockets to user-supplied URLs could reach internal services. It now connects through its own undici agent whose DNS lookup is checked on every connection, reconnections included (so DNS rebinding can't get past it); an IP address that is private or reserved throws aNetworkErrorfromwebsocket()before anything connects, and a blocked host name fails the attempt with "Blocked: …". Per connection:websocket(url, { allowPrivateNetwork }). It can't be combined with adispatcher, and while another undici global dispatcher is installed it throws instead of connecting unchecked (#116).- Credential-safe redirects:
sensitiveHeadersandallowInsecureRedirects. Custom credential headers such asX-Api-Keyfollowed a redirect to another origin; list them insensitiveHeadersand they're dropped along withAuthorization,CookieandProxy-Authorization. A redirect fromhttps:tohttp:was followed; withallowInsecureRedirects: falseit rejects with aNetworkErrorbefore anything is sent in clear text. Client or per-request options, on both Node.js transports (tested over HTTPS, for 302 and 307). Rust:ClientBuilder::sensitive_headersandallow_insecure_redirects(and per request); reqwest can't drop a header mid-redirect, so a request carrying a listed header refuses cross-origin redirects instead. Browsers follow redirects themselves, so neither applies there. The defaults are unchanged in 2.x (#115). retryBudget: a client-wide retry budget. When an upstream failed, every request in flight retried at once, multiplying the load on it. WithretryBudget: true(or{ ratio, minPerSecond, windowMs }), retries may addratioof the first attempts in a sliding window plus a minimum per second; first attempts are always sent. The budget is checked before waiting to retry and spent when the retry is sent, so cancelling while waiting spends nothing. A refused retry rejects with the attempt's own error, markedretryBudgetExhausted: true, andclient.retriesRefusedcounts refusals. One budget per client, for all origins. Rust:ClientBuilder::retry_budget(RetryBudget)andClient::retries_refused()(#117).websocket()optionsmaxQueuedMessagesandmaxQueuedBytes. Messages sent before a WebSocket opens, or while it reconnects, were queued without limit, so a producer that kept sending during an outage could fill memory. With either option, asend()that would go over throws aNetworkErrorcarrying the limit it reached (maxQueuedMessagesormaxQueuedBytes), and the message isn't queued. Bytes are UTF-8 for text and the size of binary data and Blobs. The count starts again from zero once the queue is sent.bufferedAmountno longer walks the queue (#121).maxLineBytes: a limit on one line of a newline-delimited JSON response or a Server-Sent Events stream. An incomplete line was held in memory until its line break arrived, so a server that never sent one could grow it without bound. The limit counts UTF-8 bytes without the line break, the same however the network splits the line, and it's checked before anything is buffered. The lines or events before the long one are delivered, then the stream errors with aNetworkErrorwhosemaxLineBytesis the limit, and the connection is closed; an event stream isn't reconnected. Set it on the client, perndjsonrequest or perevents()stream (nullfor none). Event streams check eachdata:line, not an event's total (#121).maxPendingRequests: load shedding. A client option that refuses a request at once while the client already has that many started and not yet settled, whether in flight or waiting for a connection (retries included; a streamed response counts until its headers arrive). The rejection is aNetworkErrorwithmaxPendingRequestsset to the limit, and nothing is sent. In Node.js, requests beyond the 1,024 handed to a transport used to wait in memory without limit; with this option, a caller that can't keep up sheds load instead. The count is per client (shared by Rust clones) and applies on every transport. Rust:ClientBuilder::max_pending_requestsandError::too_many_pending_requests(#117).
Fixed
- Node.js 20 and 22 no longer abort under bursts of cancelled requests. V8 before 13 could crash the process with "Fatal error … unreachable code" when it deoptimized
client.get(), inlined into its caller, during the call into WebAssembly; 2.5.2 and earlier did it too, in about one run in three on Node.js 20 and one in ten on Node.js 22 under 20,000 requests cancelled together. On V8 before 13 (Node.js 20 to 23), importing rust-fetch now turns that inlining off for the process (--turbo-inline-js-wasm-calls), with no measurable change in throughput on either transport. A test runs the load in six processes and fails on the crash; Node.js 24 was never affected. A--turbo-inline-js-wasm-callsor--no-…flag on the command line is left as given, and Bun, which reports a V8 version without having V8's flags, is left alone. On 2.5.2 and earlier, runnode --no-turbo-inline-js-wasm-calls(it isn't allowed inNODE_OPTIONS) or set it withv8.setFlagsFromString()before importing rust-fetch (#148). - An already-aborted
signalno longer sends the request. The request started before the signal was looked at, so on thefetch()path (browsers, other runtimes, and the browser build in Node.js) it reached the server even though it rejected with aCancelledError. Found by the conformance suite (#109). - POST and PUT bodies are resent after a 307 or 308 redirect on Node.js's
fetch(). undici in Node.js 20.20 and 22.13 detaches a byte-array body's buffer on the first attempt and can't resend it, so the redirect failed with aNetworkError. Thefetch()path now sends the body as aBlob, which it can resend (browsers send either the same way). Found by the conformance suite (#109). - The native transport warns when
NODE_TLS_REJECT_UNAUTHORIZED=0turns certificate verification off, with the warning Node prints, once per process. It honoured the variable but said nothing, since it doesn't use Node'stls; node:http requests get Node's own warning as before (#118). - A slow
for awaitloop overclient.events()no longer buffers every event. Events waiting for the loop were queued without limit, so a fast server (or a large backlog after a reconnect) could fill memory while the loop was busy. The stream now stops reading once 64 events are waiting and resumes when the loop has taken half of them, so the connection slows the server down. In a test, a server offering 20 MB of events wrote about 830 KB while the loop paused for a second, against 12 MB before: reduced read-ahead, not a fixed memory ceiling (#121).
Changed
- A pending request costs 45% less WebAssembly memory: 3.7 KB instead of 6.7 KB (7 KB in all, against 8.9 KB for 2.5.2). The wrapper that makes requests cancellable with an
AbortSignal, and the per-attempt timeout, wereasync fns whose compiled state kept two copies of the request's future; they're now plain futures that hold it once. Under sustained overload withoutmaxPendingRequests, where every pending request is kept, this moved the point where Node.js reaches its heap limit and stalls for minutes past 50,000 requests per second offered in our test (2.5.2: from 45,000). A test keeps it under a budget (#140). - The browser bundle is 31% smaller: 129 kB brotli instead of 188 kB. In WebAssembly, URLs are now parsed by the runtime's own WHATWG
URL, which implements the same standard as theurlcrate, so the module no longer carriesurl,idnaand their Unicode tables (raw: 592 → 427 kB). Native Rust keeps theurlcrate. Results are unchanged, international domain names included (bücher.example→xn--bcher-kva.example), and are checked by the same expectations on both, and on every adapter by the conformance suite; only the wording of a URL parse error now comes from the runtime. The size budget is lowered to 133 kB so the saving holds (#93). - Streamed bodies are about 30% faster. Without download progress or
maxResponseBytes, aresponseType: 'stream'body's chunks are now handed from the transport to you as they are, instead of being copied into WebAssembly and back: about 1,900 MB/s against 1,450 MB/s before when reading 256 MB from a local server (Node.js's ownfetch(): about 2,100 MB/s). Cancellation, typed errors and backpressure work as before, and every chunk still owns its whole buffer (#111). - The Node.js entry's budget (
node.js, which browsers don't load) is 38 kB raw, 12.5 kB gzip and 11 kB brotli (from 36, 12 and 10.5), for the WebSocket SSRF guard and the redirect options (36.9 kB raw). - Releases check the exact package before publishing. The release workflow packs the package, installs the tarball in an empty directory, and checks its files, a request, and the security regression tests. It then benchmarks the tarball against the version already on npm; a regression (more than 10% worse in the median and in most rounds) stops the release. After publishing, a clean install must verify its signature and provenance. Pull requests run the same checks, with the benchmark informational (#123).
- CI inputs are pinned: every GitHub Action to a commit SHA (Dependabot keeps them current), and Rust to 1.99.1 instead of whatever is stable that day, so sizes and formatting don't change on their own (#123).
- The WebAssembly module's budget was raised during 2.6.0 to 190 kB brotli and 595 kB raw (from 183 kB and 580 kB), then lowered to 133 kB brotli and 440 kB raw once #93 removed the URL parser's Unicode tables. 2.6's limits and options add about 6 kB brotli:
maxPendingRequests, SSE backpressure,maxLineBytesand the WebSocket queue limits about 2.6 kB (181.1 → 183.7 kB), the retry budget about 1.9 kB, and the redirect and WebSocket SSRF options the rest (187.2 kB on CI's Linux build, 0.3 kB more than a macOS build). #93 then recovered about 59 kB.
Documentation
- A documentation site: asemqaffaf.github.io/rust-fetch. It is also the package's homepage on npm and crates.io. The README had grown past 1,200 lines; its content now lives in
docs/(VitePress, with search), in pages for the guide, security, performance, transport conformance and reference, and is published to GitHub Pages frommain. The README keeps every badge, the overview, quick start, release status and comparison table, and links into the site. Every anchor the README used still works (the site uses GitHub's anchors), and a CI check fails on any broken link between pages, anchors and the README. The hardened configurations' test now reads them from the security page. The introduction's feature list gains the 2.6 safety and load limits. - The independent harness's 565 ms p99 stall no longer reproduces (README, Under load): rerun with aakjp/stress-test at a steady 15,000 requests per second for 60 s, 2.6.0's p99 is 19.6 ms on node:http and 4.7 ms on native; 2.3.0 shows 53 ms, 2.4.0 and later about 20 ms (#16).
- Overload without
maxPendingRequests, measured (README, Limiting pending requests): what each pending request costs, what an unbounded backlog does under sustained overload, andmaxPendingRequestsas the remedy (#140). - Memory while streaming (README, Streaming): what a slow reader keeps, what closes a connection, and who owns each chunk. The conformance suite now checks it on every transport: a slow reader holds the server back on Node.js (about 1.5 MB of 64 MB read ahead during a one-second pause), and
cancel(), an aborted signal andmaxResponseByteseach close the connection (#110). - Hardened configurations in the README's Security section: a fixed API with credentials, fetching URLs from users, and streaming APIs. Each turns on the protections that fit and says what it doesn't cover. A test reads each configuration from the README and exercises every protection its comments claim, so the README can't drift from the client (#122).
2.5.2 - 2026-10-24
A security patch: a server can no longer tie up connections, or memory on the native transport, with a long or endless redirect body. Performance: the base-against-head benchmark detected no slowdown. Comparisons against fetch() and axios were not rerun, so the comparative results in the README remain tied to the versions they tested.
Fixed
- A redirect's body is read up to 64 KiB, then its connection is closed. On the node:http transport, the body of a followed redirect was drained in the background with no end, so a server sending an endless redirect body kept that connection, and its slot in the pool of 256 per origin, busy for good. The native transport read the whole redirect body into memory before following it, so an endless one grew memory until the request timed out. Small redirect bodies are still drained so their connection is reused. Tests cover both transports: the redirect is followed promptly, each connection closes, 50 in a row keep memory bounded, and a redirect-limit error or cancellation closes them too.
Documentation
- The README's "Which transport a request uses" table said streamed responses, download progress and
client.events()use Node'sfetch()in Node.js. They have usednode:httpsince 2.4.0. - The 2.0 migration notes said
Method::to_reqwest()returns reqwest 0.12'sMethod; the crate has used reqwest 0.13 since 2.0.0. - The independent benchmark section said axios's default configuration opens a new connection per request. On Node.js 19 and later its default agent keeps connections alive; it has no socket limit, so under overload it kept opening connections until it ran out of local ports. The keep-alive axios row was capped at 128 sockets, against rust-fetch's 256 per origin, which the README now notes.
2.5.1 - 2026-10-24
Fixed
- Requests are fast again: 2.5.0 threw and caught an exception on every request without an options object. It read
maxResponseByteswithReflect.geteven when no options were passed, andReflect.get(undefined, …)throws. That nearly doubled rust-fetch's own cost per request (9.05 → 17.27 µs with an instant transport). Under load, an independent evaluation measured 18% lower throughput than 2.4.0. A request's options are now read once (Object.keyson plain objects), and unset options cost no lookup at all. Per request: 9.07 µs without options (2.4.1: 9.05 µs) and 10.71 µs with options (2.4.1: 13.27 µs, 2.5.0: 14.60 µs). A regression test fails if any option lookup could throw again. - The private-network check only computes the request host when it's turned on.
Changed
npm run bench:compare(and the benchmark job on pull requests) now also measures rust-fetch's own cost per request with an instant transport, which isn't drowned out by runner noise, and callsclient.get(url)without options in the small-JSON scenarios, as most code does.
Documentation
- The README leads with what holds at any request rate: typed errors, timeouts and retries, and safety with untrusted servers and URLs. The speed figures are qualified as high-volume results.
- New cases in When to choose something else: the server is the bottleneck, calls go through vendor SDKs, or you need a long track record.
- The comparison with
fetch()and axios gains SSRF, response-size and header-injection rows. - A Stability and releases policy: semver on 2.x, minor releases at most every two weeks from 2.6.0, patch releases only for regressions and security fixes, and how releases are checked.
2.5.0 - 2026-10-24
Added
allowAbsoluteUrls(client and per request, also forevents()andwebsocket()): withfalse, an absolute URL on a client with abaseUrlrejects with anInvalidInputErrorinstead of replacing the base URL, and so the client's headers such asAuthorizationcan't be sent to a host taken from user input (the class of axios CVE-2025-27152). Defaulttrue, as before. Rust:allow_absolute_urls()onClientBuilderandRequestBuilder.maxResponseBytes(client and per request;nullper request for none): rejects responses whose decompressed body is larger, with aNetworkErrorthat carries the limit asmaxResponseBytes. Checked againstContent-Lengthbefore reading, counted while reading, and enforced while decompressing (gzip, deflate, brotli, zstd stop one byte past the limit), so a decompression bomb never expands in memory: a 64 MB gzip bomb with a 1 MB limit fails with no measurable memory growth. Applies on every transport, to error bodies, and to streamed bodies (the stream errors). Rust:max_response_bytes()onClientBuilderandRequestBuilder, andError::response_too_large().- SSRF protection:
allowPrivateNetwork: false(Node.js, client and per request): requests to private and reserved addresses reject with aNetworkErrorbefore connecting. Blocked: loopback, RFC 1918, link-local (cloud metadata), CGNAT, multicast, reserved and documentation ranges, IPv6 unique-local/link-local/multicast, and IPv4-mapped and NAT64 forms. Every address a name resolves to is checked when connecting (DNS rebinding can't slip past), IP-literal hosts before the request, on every redirect; checked requests use their own connection pool. Through a proxy, only IP-literal targets are checked. Not applied towebsocket(); ignored in browsers. - README Security section: what the client protects against, and a comparison with
fetch()and axios (npm run security:compare). - Security regression tests (
security.test.mjs, both Node.js transports): one test per vulnerability class found in other clients, named after the advisories, so a change that reintroduces one fails CI. - The Node.js entry point is 33.2 kB (11.1 kB gzipped) with the SSRF guard; its budget is 36 kB / 12 kB. Browsers don't load it.
- The WebAssembly module's brotli budget is 183 kB (from 180 kB) for these limits, until #93 removes the URL parser's Unicode tables.
2.4.1 - 2026-10-23
Fixed
- Requests are about 5% faster again: 2.4.0 had made every request slower. Every request looked up the eight browser
fetch()options (credentials,mode, …), one call into JavaScript each, even when none were set and in Node.js, where they're only validated. OneObject.keyscall now skips them when none are set. Published 2.4.0 against this fix (fresh processes, 9 interleaved rounds, node:http transport): small JSON sequential +2.7%, 50 concurrent +5.2%, back to 2.3.0's level. Found by comparing the published 2.3.0 and 2.4.0 packages, and swapping their WebAssembly modules and JS transports, to isolate the cause.
2.4.0 - 2026-10-23
Added
- Proxies in Node.js: a
proxyclient option,'env'(HTTPS_PROXY,HTTP_PROXYandNO_PROXY, upper or lower case, read on each request) or a proxy URL with optional credentials (sent asProxy-Authorization). HTTPS goes throughCONNECTtunnels, plain HTTP as absolute-URL requests, with a connection pool per proxy;http:andhttps:proxies are supported.NODE_USE_ENV_PROXY=1turns on'env'by default, as it does for Node'sfetch(). Proxied requests use thenode:httptransport. The Node.js entry point grows to 22.4 kB (7.8 kB gzipped); its budget is now 24 kB / 8.5 kB. - WebSockets through a proxy in Node.js: a
dispatcheroption forclient.websocket(), passed to Node's built-inWebSocket, e.g.new ProxyAgent(url)from theundicipackage. Tested through a localCONNECTproxy with proxy credentials. Browsers reject it with anInvalidInputError(they use the system's proxy settings). - Browser
fetch()options:credentials,mode,cache,keepalive,priority,referrer,referrerPolicyandintegrity, as client defaults and per request (each overriding the client's), for buffered and streamed requests andclient.events().mode: 'no-cors'resolves with the opaque response (status: 0). With upload progress,credentials: 'include'setsXMLHttpRequest.withCredentials; other options send the request withfetch(), which reports upload progress once. Node.js requests don't use them (they're validated). Tested with real cookies, the HTTP cache andno-corsin Chromium, Firefox and WebKit. Adds 1.4 kB brotli to the module. - Redirect control:
redirect: 'follow' | 'manual' | 'error'andmaxRedirects, as client options and per request, withfetch()'s semantics.'manual'resolves with the redirect response (ok: false, with itsLocationheader);'error'rejects with aNetworkErroron any redirect;maxRedirects(default 20, as before) limits how many are followed in Node.js, on both transports. In browsers,fetch()hides redirects from scripts, so'manual'resolves withstatus: 0and no headers, and the browser's own limit applies. In the Rust API:Redirect, andredirect()/max_redirects()onClientBuilderandRequestBuilder.
Fixed
- Node.js: throughput no longer collapses when far more requests are sent than the server answers. With a backlog of hundreds of thousands of requests (an offered 40,000/s from one process, no load shedding), the node:http transport delivered about 600 requests/s, because every waiting request was already a
ClientRequestqueued in Node's agent, and WebAssembly memory grew one 64 KB page at a time. Now at most 1,024 requests are handed to a transport at once and the rest wait in an O(1) queue (their wait counts towardstimeoutMs; cancelling one drops it before it's sent), and memory grows in steps of an eighth of its size. Same test: 11,868 requests/s with node:http, and 37,956 (from 28,353) with the native transport, whose WebAssembly memory peaked at 104 MB instead of 442 MB. In the independent harness at an offered 40,000/s, peak memory fell from 506 to 387 MB (node:http) and from 722 to 660 MB (native) at the same throughput, and at a steady 15,000/s the node:http transport no longer showed its intermittent stall (#16) in the runs so far.
Changed
- Native transport: one Tokio worker thread, with large compressed bodies (over 16 KB) decoded on the blocking pool. Against the previous build (one worker per core), in fresh processes over 5 interleaved rounds: sequential small JSON +7.3%, now level with the node:http transport; 8 MB bodies +5.5%; 50 concurrent unchanged; +9% delivered at an offered 40,000 requests/s with a lower p99. Decoding off the runtime thread also speeds up concurrent gzip responses by about 50% (5,196 to 7,756 per second for 0.6 MB bodies, 8 concurrent).
- Benchmarks on every pull request: a CI job compares the PR's package with its base branch (small JSON sequential and 50 concurrent, an 8 MB body and startup, on both Node.js transports, and the bundle size), in fresh processes over interleaved rounds, and flags changes over 10% worse that reproduce in most rounds.
npm run bench:compareruns it locally. - Startup measured (
npm run bench:cold, README Startup): in a fresh Node.js 22 process the first response arrives in 25.5 ms with the native transport and 27.6 ms with node:http, against 21.9 ms forfetch(); in browsersinit()plus the first request takes 15–18 ms with an empty cache and 4–16 ms cached. Most of Node's import time is loadingnode:http, whichfetch()pays too. The README now covers serving the.wasmfile asapplication/wasmand preloading it. - Node.js: streamed responses (
responseType: 'stream' | 'ndjson') andevents()go through thenode:httptransport instead of Node'sfetch(), like other requests. So they honourproxy, share the bounded connection pool, and are decompressed as they arrive (gzip, deflate, brotli, zstd). Small streamed requests are about 25% faster (3,700 vs 2,950 req/s at 50 concurrent, 64 KB each); large single streams are within 5% offetch()(about 1,080 vs 1,140 MB/s). The Node.js entry point is 24.7 kB (8.4 kB gzipped); its budget is now 26 kB / 9 kB (30 kB / 10 kB with the request queue, at 27.7 kB). - Smaller browser bundle: 187.9 kB brotli, down from 204.8 kB in the published 2.3.0 (WebAssembly 195.2 → 178.5 kB, JS glue 9.6 → 9.4 kB; both built with Rust 1.99, as releases are). Sizes quoted for earlier releases came from local builds with an older Rust, which produces a module about 11 kB larger. In JavaScript runtimes, streamed requests (
responseType: 'stream' | 'ndjson',events()) are now sent withfetch()directly instead of through reqwest's wrapper around it, so reqwest's WebAssembly code is no longer in the module. The size budgets are lowered to match: 640 kB raw / 250 kB gzip for the.wasm, 70 kB / 11.5 kB forrust_fetch.js(its raw size varies by about 2 kB between wasm-bindgen builds). - Streamed responses honour
redirecttoo, like other requests. - Download progress is reported for each chunk on every path: in browsers it was reported once when combined with upload progress, or in service workers. In Node.js, requests with only
onDownloadProgressnow use thenode:httptransport instead of Node'sfetch(). - Rust API:
RequestConfig'sfollow_redirectsandmax_redirectsare now applied (they were ignored), and the default limit is 20, like browsers and the JavaScript API, instead of reqwest's 10. - The Node.js entry point's raw size budget is now 18 kB (it's 17.1 kB, 6.1 kB gzipped).
2.3.0 - 2026-10-23
Added
- Web Workers and service workers are tested in CI in Chromium, Firefox and WebKit: requests, typed errors, upload progress (one report in service workers, which have no
XMLHttpRequest), Server-Sent Events and WebSockets. - Server-Sent Events:
client.events(url, options)reads an event stream in browsers and Node.js, with any method, headers and body (as streaming LLM APIs need), the client's base URL, interceptors, timeouts and typed errors. Events are parsed in Rust to the WHATWG spec (event, multi-linedata,id,retry, comments, BOM, CR/LF/CRLF, characters split across chunks). Reconnection sendsLast-Event-IDand honoursretry:, on by default forGET.messageType: 'json'parsesdataand stops atdata: [DONE]. Use callbacks (onEvent, …) orfor await;breakcloses the stream.opened/closedpromises,signal,close(). - Newline-delimited JSON:
responseType: 'ndjson'returns aReadableStreamof parsed values, one per line, as lines arrive. A line that isn't JSON errors the stream with aParseErrornaming the line. - The browser bundle grows by about 10 kB brotli for these two features, from 206.8 to 217.4 kB (WebAssembly 197.7 → 207.8 kB, JS glue 9.1 → 9.5 kB); the size budgets are now 700 kB raw / 275 kB gzip for the
.wasmand 70 kB / 12 kB forrust_fetch.js. - Real-browser tests in CI: the browser entry runs in Chromium, Firefox and WebKit (Playwright), covering requests, typed errors, timeouts, retries, cancellation, streaming, download and upload progress (with a cross-origin preflight) and WebSockets (
npm run test:browsers).
2.2.0 - 2026-10-23
Added
- Typed responses in TypeScript: every
WasmClientrequest method is generic over the response body, e.g.client.get<User>('/users/42')resolves toHttpResponse<User>. The type parameter defaults toany, so existing code type-checks unchanged. - Upload progress: an
onUploadProgress({ loaded, total })request option. In Node.js the body is written in 64 KB chunks and each is reported once it's handed to the OS. In browsers these requests go throughXMLHttpRequest, sincefetch()has no upload progress events, with the same redirects, credentials, timeouts, retries and errors; cross-origin ones are preflighted. WithoutXMLHttpRequest(service workers), progress is reported once, when the response arrives. It can be combined withonDownloadProgress, but not withresponseType: 'stream'. Requests with progress callbacks don't use the native transport. - WebSockets:
client.websocket(url, options)opens a connection through the runtime'sWebSocket(browsers; Node.js 22+, or 20 with--experimental-websocket). URLs resolve againstbaseUrl(http:→ws:,https:→wss:), withparams, subprotocols, handshake headers in Node.js (merged over the client's), a per-attempt connect timeout, optional reconnection with jittered exponential backoff, JSON messages, anAbortSignal,opened/closedpromises and typed errors. Messages sent before the connection opens are queued. - The browser bundle grows by about 16 kB brotli, from 190.9 to 206.8 kB (WebAssembly 183.1 → 197.7 kB, JS glue 7.8 → 9.1 kB), for these two features; the size budgets are now 660 kB raw / 260 kB gzip for the
.wasm, 65 kB / 11.5 kB forrust_fetch.jsand 17 kB / 6.5 kB fornode.js. - Native Node.js transport (not yet in the npm package).
native/builds a Node-API addon that moves requests off the JS thread: HTTP/1.1 on hyper and Tokio, with the same rules as the node:http transport (fetch() redirects, decompression, default headers, per-attempt timeout, cancellation, at most 256 connections per origin) and Node's TLS defaults (Mozilla root certificates,NODE_EXTRA_CA_CERTS,NODE_TLS_REJECT_UNAUTHORIZED=0). Retries, timeouts, validation, errors and interceptors still come from the Rust core, unchanged. Whenrust-fetch-native.<platform>-<arch>.nodesits next to the package'snode.js, it is used wherever the node:http transport would use its own pool; an agent installed ashttp.globalAgent/https.globalAgent, orNODE_USE_ENV_PROXY, keeps node:http.RUST_FETCH_NATIVE=0turns it off. Build it withnpm run build:native. - The Node.js entry point (
node.js) grows by about 1 kB (to 15 kB, 5.5 kB gzipped) for the native transport's loader; its size budget is now 16 kB (6 kB gzipped). Browsers don't load it.
Changed
- npm and crate metadata: a description that lists what the client does, without the "faster than fetch()" claim (the published client is behind
fetch()on concurrent HTTPS); more npm keywords; the package shipsllms.txt, a concise API summary for AI assistants. - Development uses TypeScript 7; the published definitions are type-checked with TypeScript 7 and 5.2.
2.1.1 - 2026-10-22
Fixed
- Node.js: bursts of requests no longer exhaust ephemeral ports. Node's default global agents open a new socket for every request that finds no idle one and keep only 256 afterwards; the rest were closed into TIME_WAIT, and under sustained overload every connect failed with
EADDRNOTAVAIL(50,000 req/s against a local server: 2.7k req/s delivered, 43.5k errors). rust-fetch now uses its own pool of up to 256 keep-alive connections per origin and queues further requests (same test: 18.9k req/s, no errors). Throughput below saturation is unchanged. An agent you install ashttp.globalAgent/https.globalAgent(e.g. a proxy), or Node's own agent with amaxSocketslimit you set, is still used as before.
2.1.0 - 2026-10-22
Changed
- Node.js requests no longer go through
fetch(). A lean transport onnode:http/node:httpswith keep-alive connections makes rust-fetch as fast as or faster than Node's built-infetch(): small JSON requests are 1.9× (sequential) to 2.2× (50 concurrent) faster than in 2.0.0. It follows redirects likefetch()(dropping credentials on cross-origin redirects), decodes gzip, deflate, brotli and (where Node supports it) zstd, and sendsaccept: */*,accept-encodinganduser-agent: rust-fetchunless set. Retries, timeouts, validation and errors still come from the Rust core. Browsers keep usingfetch(). - In Node.js, proxies now come from
http.globalAgent/https.globalAgentinstead of undici'ssetGlobalDispatcher - Buffered responses (everything except
responseType: 'stream'and requests withonDownloadProgress) are decoded in JS without copying the body into Wasm memory - Binary responses are returned without an extra copy
- Finished requests no longer create an
AbortErroreach, which removed about 13% of the CPU time of a small request - The npm description no longer says "high-performance"; it describes what the package does
2.0.0 - 2026-10-22
Breaking changes
See "Upgrading to 2.0" in the README for migration steps.
- Timeouts are enforced in browsers and Node.js (default 30 s per attempt); they were silently ignored in 1.x
WasmClientJSON bodies are plain objects instead ofMapsapplication/*+jsonresponses are parsed as JSON in auto mode, and empty bodies arenull- Errors are
Errorinstances;messageis no longer an enumerable own property - Invalid
headersvalues reject withInvalidInputErrorinstead of being silently dropped - Response text is decoded as UTF-8 regardless of the
charsetparameter - The package has an
exportsmap (Node.js and browser entries); only the documented paths can be imported - Node.js 20 or newer is required
- Rust:
RetryConfighas a newretry_non_idempotentfield;Method::to_reqwest()returns reqwest 0.12'sMethod;RequestBuilder::header()replaces default headers with the same name;WasmClientmethods take an options argument
Added
WasmClientoptions:baseUrl,headers,timeoutMsandretries(count orRetryOptions)- Per-request options on every method:
headers,params,timeoutMs,responseType,signal,onDownloadProgress post/put/patch(url, { body, ... })andfetch(url, init)- Request cancellation with
AbortSignal, including during retry backoff and while streaming - Streaming responses:
responseType: 'stream'(aReadableStream);send_streaming()/get_streaming()in Rust - Download progress callbacks (
onDownloadProgress;on_download_progress()in Rust) multipart/form-datauploads fromFormData(including files);Blob/File,ArrayBuffer,DataViewandURLSearchParamsbodies;Multipartbuilder in Rust- Request and response interceptors:
addRequestInterceptor,addResponseInterceptor,ejectInterceptor,clearInterceptors - Node.js entry point: no
init()or manual.wasmloading needed; conditionalexportsfor Node.js and browsers - TypeScript definitions for all options, responses and errors
Retry-Aftersupport, jittered backoff,retry_non_idempotentoption- Benchmark against native
fetch(npm run bench) - Test suites: Rust integration tests against a local server, wasm tests in Node.js, JS end-to-end and package-install tests; CI with a 100% line-coverage gate for the Rust core
Changed
- Errors thrown to JS are real
Errorinstances;nameequalskind - POST and PATCH are no longer retried unless
retryNonIdempotent/retry_non_idempotentis set - Only statuses listed in
retryOnare retried (default[408, 429, 500, 502, 503, 504]) - Per-request headers replace client default headers with the same name instead of being sent twice
fetch_jsonparses JSON regardless ofContent-Type; empty bodies arenullapplication/*+jsonresponses are parsed as JSON in auto mode; empty responses arenull- Long error bodies are truncated in error messages (the full body stays on
error.body) - Upgraded to reqwest 0.13. Native (non-wasm) Rust builds now use rustls with aws-lc instead of OpenSSL for TLS; the npm package is unaffected
Fixed
- Timeouts were ignored in browsers and Node.js, so stuck requests could hang forever
- Retry delays used
window.setTimeout, which crashed in Node.js and Web Workers WasmClientreturned JSON objects asMaps- JSON containing integers above 2^53 failed the whole request
- An explicit
Content-Typewas sent alongside a default one (e.g.application/json, text/plain) Uint8Arrayrequest bodies failed;URLSearchParamsbodies were sent emptybaseUrlwas blindly concatenated (missing or doubled slashes; absolute URLs were broken)- Invalid URLs and headers were reported as retryable network errors
TRACE/CONNECTfailed with an opaque "builder error"; they're now rejected with a clear message- Retry delay calculation could panic with very large
max_delay/multipliervalues - Updated dependencies with security advisories:
bytes(RUSTSEC-2026-0007, also in the wasm build) andopenssl(RUSTSEC-2025-0004, RUSTSEC-2025-0022, native builds only) - The npm package's broken
client.js/server.jswrappers and staletypes.d.tswere removed
1.1.0 - 2025-07-27
Added
- Extended HTTP Methods: Added support for PUT, DELETE, PATCH, and HEAD methods in
WasmClient - Flexible Request Method: New
request()method inWasmClientfor custom HTTP requests with headers and body - TypeScript Definitions: Comprehensive TypeScript type definitions (
types.d.ts) with detailed interfaces:HttpResponseinterface for type-safe responsesRequestOptionsinterface for request configurationHttpErrorinterface for structured error handlingClientConfiginterface for client configuration
- Enhanced Error Handling: Added
Fromimplementation forserde_wasm_bindgen::Error - Comprehensive Tests: Added extensive test suite in
tests/client_tests.rs - Better Documentation: Improved inline documentation and code examples
Changed
- Error Conversion: Improved error conversion from JavaScript values
- API Consistency: Standardized method naming (e.g.,
put_json,patch_jsonfor JSON payloads)
Fixed
- Duplicate Implementation: Removed duplicate
Fromimplementation forserde_wasm_bindgen::Error
1.0.4 - 2025-07-26
Added
- World-class WebAssembly HTTP client library
- Excellent error handling with detailed context
- Clean API design with builder pattern
1.0.2 - 2025-07-26
Added
- Basic HTTP client implementation with builder pattern
- Support for GET, POST, PUT, DELETE, PATCH methods
- Retry logic with exponential backoff
- WASM bindings for browser and Node.js
- Error handling system with structured error types
- Response format handling (JSON, text, binary)
Features
- Type-safe HTTP client
- Comprehensive error handling
- Automatic retries for transient failures
- Platform optimizations for WASM and native targets
- Backward compatibility with legacy APIs
0.7.2 - 2025-02-24
Added
- Initial WASM module structure
- Basic fetch functions for JSON and text
- Simple HTTP client wrapper
Changed
- Project structure reorganization
- Updated dependencies
0.1.0 - 2025-02-23
Added
- Initial release
- Basic HTTP functionality using reqwest
- WASM compilation support
- Simple fetch APIs