# What changed in @effect/platform-node

> 34 changes in @effect/platform-node 0.108 to 4 from its official release notes, upgrade guides and advisories: 12 breaking, 1 security, 5 new APIs and options. Each one cited. Sources checked 2026-10-28. HTML: https://unstale.sh/npm/@effect/platform-node/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @effect/platform-node 4

### Breaking changes

- Adds `upgradeWith({ headers })`; `upgrade` is now `upgradeWith({})`. Third-party HttpServerRequest implementations must add it, and WebSocket upgrades fail when headers are given. (4.0.7) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.7)
- Waits for the request body to end before writing the 101 response. On Node 25 and older, reads Content-Length bodies from the connection and answers chunked bodies with 411 Length Required. (4.0.7) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.7)
- When its source stream errors, NodeMultipart now fails with a MultipartError instead of waiting for more input. (4.0.7) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.7)
- Custom HttpClientResponse implementations must add upgrade. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- The middleware now requires a trusted-proxy policy and applies forwarded headers only when the connecting peer is trusted. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- toURL no longer reads x-forwarded-proto directly; it uses request.protocol, set by trusted proxy middleware, before the transport scheme. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- Node server requests expose an absolute originalUrl when a Host header is present; use url instead of originalUrl to read the path. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- For absolute-form Node requests, url and headers.host are derived from the request target, ignoring a conflicting Host header. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- Multipart requests missing a boundary now return a typed parse error instead of a defect. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- Oversized buffered or decompressed request bodies now receive 413; Node drains oversized bodies so the response can reach the client without destroying the socket. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- Handlers returning a status outside 200–599 now receive a 500 response. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- The return type now includes HTTP/2 request and response types; code using HTTP/1.1-only members must narrow first. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)

### Security

- Streaming payloads can be limited by byte size; exceeding the limit fails the stream with HttpApiPayloadTooLarge (413), and excessive content-length is rejected before the handler runs. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)

### New APIs and options

- Upgrade endpoints can declare buffered payloads and typed 101 response headers; clients decode the headers, handlers receive an upgrade function, and 426 is returned before payload decoding. (4.0.7) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.7)
- Node stream readers expose MaxBytesError and an optional destroyOnOverflow setting; the default destruction behavior is unchanged. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- NDJSON streaming payloads are supported; invalid lines fail the stream with HttpApiSchemaError (400), and StreamNdjson also works as a success response. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- Endpoints can declare streaming request payloads; handlers receive a lazy Stream that reads the body as it pulls. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- Raw HTTP/1.1 upgrades are supported through the client and Node HTTP server; Node clients expose the upgraded connection as a Socket. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)

### Performance

- Importing effect/Schema or starting a Node HTTP server before web APIs are used no longer loads Node's internal undici on cold start. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)

### Behavior and default changes

- Streaming request bodies continue uploading after response headers arrive, enabling bidirectional streaming; unfinished uploads stop when the response is consumed, the connection closes, or the request is cancelled. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)

### Fixes and other changes

- Fixes hanging or reporting a defect when an HTTP/1 client disconnects before the response is written. (4.0.7) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.7)
- Fixes hanging when the source closes early or is already destroyed, including while a file part is being read, and removes source listeners once parsing finishes. (4.0.7) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.7)
- The server defers 100 Continue until the application reads the request body, preventing early rejections from prompting uploads. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- HTTP/2 uses authority for the exposed host header and request URL, including when Host is missing or conflicting. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- HTTPS detection now prioritizes an exact http or https x-forwarded-proto value, otherwise infers HTTPS from originalUrl; paths beginning with // preserve the request host. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- Stream body encoding errors are preserved instead of being reported as transport errors caused by request cleanup. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- Sending HttpBody.formData request bodies no longer hangs. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- The server drains up to 256 KiB of an unread request body, then closes the connection rather than reading the whole upload or leaving the socket stuck. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- make, layerServer, layer, and layerConfig accept HTTP/2 servers created with Http2.createServer() or Http2.createSecureServer(), including allowHTTP1. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- HTTP/2 responses drop forbidden connection-specific headers, failed bodies reset the stream with INTERNAL_ERROR, and shutdown closes idle sessions. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- When Node rejects response headers, the server sends a fallback error response or destroys the response if that also fails, avoiding hanging requests. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- Writables are released when upstream fails or the sink is interrupted, preserving the original exit cause; writables with endOnDone: false remain open. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)
- If a streamed response body fails after headers are sent, the connection is aborted so clients do not treat a truncated body as complete. (4.0.6) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%404.0.6)

## @effect/platform-node 0.108

### Fixes and other changes

- Fixes the method to return an ArrayBuffer instead of a Uint8Array, matching its expected return type. (0.108.4) — [release notes](https://github.com/Effect-TS/effect/releases/tag/%40effect/platform-node%400.108.4)
