Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fetch response status text #2588

Merged
merged 2 commits into from Feb 17, 2024
Merged

fix: fetch response status text #2588

merged 2 commits into from Feb 17, 2024

Conversation

mikicho
Copy link
Contributor

@mikicho mikicho commented Feb 13, 2024

@mikicho mikicho requested a review from gr2m February 13, 2024 17:06
@mikicho mikicho changed the base branch from main to beta February 13, 2024 17:06
@@ -37,7 +38,7 @@ function createResponse(message) {

return new Response(responseBodyOrNull, {
status: message.statusCode,
statusText: message.statusMessage,
statusText: STATUS_CODES[message.statusCode],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not?

Suggested change
statusText: STATUS_CODES[message.statusCode],
statusText: message.statusMessage || STATUS_CODES[message.statusCode],

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Uzlopak I'm not against adding this, but from what I see, we never set this, so it will always be null

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say if STATUS_CODES[message.statusCode] passes all our tests, I'd go with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small note: This is fetch-only code, so we don't have a big coverage here.

@gr2m gr2m changed the title Michael/fix fetch status text fix: fetch response status text Feb 17, 2024
@mikicho mikicho merged commit 11adf2c into beta Feb 17, 2024
14 checks passed
@mikicho mikicho deleted the Michael/fix-fetch-status-text branch February 17, 2024 22:44
Copy link

🎉 This PR is included in version 14.0.0-beta.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node 18+: make nock work native fetch
3 participants