feat: expose statusText in request() ResponseData#4784
Merged
mcollina merged 1 commit intonodejs:mainfrom Jan 31, 2026
Merged
Conversation
Fixes: nodejs#4783 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
metcoder95
approved these changes
Jan 30, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4784 +/- ##
=======================================
Coverage 93.25% 93.26%
=======================================
Files 109 109
Lines 34023 34024 +1
=======================================
+ Hits 31729 31733 +4
+ Misses 2294 2291 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Merged
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.
Fixes: #4783
This relates to...
#4783
Rationale
Although status text is already captured by the HTTP parser and passed through the request chain via
onHeaders(statusCode, rawHeaders, resume, statusMessage), it was being dropped and not exposed in theResponseDatareturned byrequest(). This makes it difficult for libraries like jsdom that need access to the status text for web platform API compatibility.Although status text is kind of a useless feature, and so I understand the desire to omit it, the cost of passing this along is minor, and most consumers can ignore it, so I wanted to propose that we keep passing it.
Changes
Expose
statusMessage(received from the parser) asstatusTextin theResponseDataobject returned byrequest().Features
statusTextproperty toResponseDatareturned byrequest()Bug Fixes
N/A
Breaking Changes and Deprecations
N/A
Status
Point for discussion
statusTextorstatusMessage? Undici uses both internally. Fetch usesstatusText. Node.js usesstatusMessage. I'm fine either way.