v3.1.0
·
8 commits
to main
since this release
Release Notes
Request, Response, and streaming bodies
- stream
Blob,ReadableStream, async iterable, and iterable request bodies through the native transport with backpressure instead of buffering them in JS - preserve content length and MIME type for streamed blobs
- support aborts and source errors for raw and multipart upload streams
- replay blob and multipart bodies across retries and body-preserving redirects, while rejecting retries or redirects for already-consumed one-shot streams
- consume global
Requestbodies as streams instead of callingarrayBuffer() - align
Request.body,bodyUsed, cloning, transfer, GET/HEAD body validation, URL parsing, credential rejection, and method normalization with Fetch behavior - preserve explicit
Content-Typeheaders forFormData - expose MIME types from
Request.blob()andResponse.blob()and addbytes()readers - expand
Headerscompatibility with global headers, tuple validation,keys(),values(), andforEach() - expose
Requestas a named ESM export and add compile-time compatibility checks against the global Fetch types
WebSocket
- support the standard
new WebSocket(url, protocols)constructor form and converthttp:/https:URLs tows:/wss: - cancel an in-progress native handshake when
close()is called duringCONNECTING, preventing a later spuriousopenevent - keep queued sends ordered and wait for them before starting the closing handshake
- use a bounded native command channel and acknowledge writes after they reach the socket
- snapshot mutable binary payloads at
send()call time - align
send()behavior inCONNECTING,CLOSING, andCLOSEDstates and improvebufferedAmounttracking - report close state from the actual peer handshake instead of synthesizing a clean close immediately
- populate
MessageEvent.origin, use WHATWG-styleDOMExceptionerrors for protocol validation, and ignore invalidbinaryTypeassignments - surface cookie jar failures through the normal
errorandcloseevent path - clean up native WebSocket handles when event or command streams terminate
Native resource lifecycle
- release stored response bodies when reading a body chunk fails, preventing leaked connections and pool slots (#23)
- cancel intermediate response bodies discarded by redirects, retries, hooks, or response replacement
- add finalizer-backed cleanup for abandoned native response streams
- cover response and WebSocket store cleanup with Rust and integration tests
Tests and tooling
- add coverage for raw and multipart streaming, aborts, stream failures, retries, redirects, Request/Response body lifecycle, ESM exports, and WHATWG type compatibility
- add WebSocket coverage for connecting cancellation, queued send ordering, mutable payload snapshots, cookie errors, origin, protocols, and close semantics
- update
oxfmtfrom0.60to0.61
New contributor
Special thanks to @chad-loder for identifying and fixing the failed response-body cleanup leak in #23. That fix prevents broken streamed responses from retaining a socket and exhausting the connection pool over time.