fix(res.send): preserve ETag generation with Transfer-Encoding - #7459
Merged
Merged
Conversation
krzysdz
suggested changes
Sep 7, 2026
krzysdz
left a comment
Contributor
There was a problem hiding this comment.
Please change the things mentioned in comments.
By the way, using res.send() with Transfer-Encoding may be tricky. Node.js can transfer chunked data, but different values, such as gzip, will result in an invalid response. #4893 (review)
Signed-off-by: cuishuang <imcusg@gmail.com>
krzysdz
approved these changes
Sep 8, 2026
Open
bjohansebas
approved these changes
Sep 15, 2026
UlisesGascon
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preserve automatic ETag generation when
res.send()is used with a pre-existingTransfer-Encodingheader.Commit
18e5985bcorrectly preventedContent-Lengthfrom being added whenTransfer-Encodingis present, but it also moved the body-length calculation inside the same condition.Because automatic ETag generation depends on the calculated body length, responses using
Transfer-Encodingstopped receiving an ETag.