Files
bun.sh/test/regression
Claude Bot 7ab5cf7a34 fix(http): silently discard trailers when chunked encoding not used
Per Node.js documentation, `res.addTrailers()` should silently discard
trailers when chunked encoding is not enabled, rather than throwing an
error. This matches Node.js behavior where trailers set via addTrailers()
are only emitted if chunked encoding is used.

Previously, Bun threw ERR_HTTP_TRAILER_INVALID when trailers were set
via addTrailers() and chunked encoding was not enabled. Now we only
throw when the "Trailer" header is explicitly set (indicating intent
to send trailers), while silently discarding trailers set via
addTrailers() when chunked encoding is not in use.

Fixes #26171

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 17:57:57 +00:00
..