Repository navigation
Fall back to the standard status text when statusText is empty (1.2.1) - #10
Merged
Merged
Conversation
HTTP/2 responses have no reason phrase, and Node 26's fetch (undici 8) negotiates HTTP/2 with servers that support it, so response.statusText is '' and the message was "500 " instead of "500 Internal Server Error". Use http.STATUS_CODES[status] when statusText is empty so the same error has the same message (and APM grouping) over HTTP/1.1 and HTTP/2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coverage Report for CI Build 40494088133Coverage increased (+0.2%) to 96.552%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
On Node 26, walmart-marketplace's "should throw error for non 200 status code" tests fail: they expect
500 Internal Server Errorbut get500.Root cause: Node 26's
fetch(undici 8) negotiates HTTP/2 with servers that support it, and HTTP/2 has no reason phrase, soresponse.statusTextis empty.HttpErrorbuilds its message from${status} ${statusText}. Checked locally against httpbingo.org: Node 24.13.0 (undici 7.18.2) gives"Internal Server Error", Node 26.8.1 (undici 8.10.0) gives"".Fix: when
statusTextis empty, usehttp.STATUS_CODES[status], so the same error has the same message (and APM grouping) over HTTP/1.1 and HTTP/2. A status code with no standard text keeps the old"599 "message. Adds tests, a 1.2.1 changelog entry, and a README note.Every package that depends on
~1.2.0without a lockfile (walmart-marketplace included) picks this up on its nextnpm installonce 1.2.1 is published.🤖 Generated with Claude Code