Improve test coverage for res.set() edge cases#7050
Open
RlxChap2 wants to merge 2 commits intoexpressjs:masterfrom
Open
Improve test coverage for res.set() edge cases#7050RlxChap2 wants to merge 2 commits intoexpressjs:masterfrom
res.set() edge cases#7050RlxChap2 wants to merge 2 commits intoexpressjs:masterfrom
Conversation
res.set() edge cases
IamLizu
reviewed
Apr 4, 2026
Member
IamLizu
left a comment
There was a problem hiding this comment.
Thanks for the contribution. I am mostly 👍 on this.
One caveat: this adds an assertion that preserves current implicit Content-Type normalization behavior (text/plain -> text/plain; charset=utf-8). That is correct today, but may conflict with the direction discussed in #7145 / #7146 for 6.x.
If we want to preserve current res.set() semantics on this line, this looks good to merge. If the 6.x pass-through direction is preferred, this test should be revised accordingly.
Author
|
Thanks for the review. These tests are intended to document and validate the current |
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.
Summary
Add edge case tests for
res.set()to ensure headers behave correctly with uncommon inputs.Motivation
Some header scenarios were not explicitly tested, such as empty values, case-insensitive field names, and overwriting existing headers. These tests document and validate the current behavior.
Changes
Testing
npm testNotes
No functional changes; tests only.