Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-content-length-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/platform": patch
---

fix: stop emitting content-length header in HttpClientRequest.setBody
8 changes: 3 additions & 5 deletions packages/platform/src/internal/httpClientRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,9 @@ export const setBody = dual<
if (contentType) {
headers = Headers.set(headers, "content-type", contentType)
}

const contentLength = body.contentLength
if (contentLength) {
headers = Headers.set(headers, "content-length", contentLength.toString())
}
// Do not set content-length here — the transport layer (fetch/undici)
// computes the correct value from what it actually sends on the wire.
// See https://github.com/Effect-TS/effect/issues/6240
}
return makeInternal(
self.method,
Expand Down
Loading