Repository navigation
fix: match numeric header expectations - #913
Open
sricharanreddycheruku wants to merge 1 commit into
Open
sricharanreddycheruku wants to merge 1 commit into
sricharanreddycheruku wants to merge 1 commit into
Conversation
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.
Numeric header expectations are already accepted by
expect(), but matching values fail because HTTP headers are strings. For example,.expect('Content-Length', 3)reportsexpected "Content-Length" of "3", got "3".Convert only numeric expectations to strings before the existing comparison. String and regular-expression expectations retain their behavior. The README now lists the numeric argument type.
Four HTTP regression cases cover matching Content-Length, zero, negative and fractional values. All four fail on unchanged source. A control rejects
"03"when expecting3, and the existing incorrect-number test remains intact.Validation on Linux:
npm testpasses on Node 18.20.8, 20.20.0, 22.19.0 and 24.19.0. Each run includes ESLint, all 142 Mocha tests, leak checks and NYC coverage, with no skipped tests.npm run coveragepasses on Node 24.19.0.git diff --checkpass.Windows, macOS and upstream CI have not been run for this change.
Checklist