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

Inconsistency with undefined status (and maybe statusText) #1094

Closed
gzuidhof opened this issue Nov 12, 2021 · 0 comments · Fixed by #1100
Closed

Inconsistency with undefined status (and maybe statusText) #1094

gzuidhof opened this issue Nov 12, 2021 · 0 comments · Fixed by #1100
Labels
bug Something isn't working

Comments

@gzuidhof
Copy link
Contributor

Bug Description

In the ResponseInit body one should be able to pass status: undefined to have behavior akin to the browser API, in which case the status should become 200 instead of throwing an error

Reproducible By

import { Response } from "undici";
new Response("", { status: undefined }); // throws TypeError

Expected Behavior

No error, and the status is 200 for the Response.

@gzuidhof gzuidhof added the bug Something isn't working label Nov 12, 2021
gzuidhof added a commit to gzuidhof/undici that referenced this issue Nov 16, 2021
Fixes nodejs#1094, but I'm not 100% sure if deleting the statusText is the nicest way to deal with this as we're mutating the input object.
ronag pushed a commit that referenced this issue Nov 17, 2021
* Handle undefined status and statusText

Fixes #1094, but I'm not 100% sure if deleting the statusText is the nicest way to deal with this as we're mutating the input object.

* Add test, make patch simpler

* Lint fixes

* Improve
KhafraDev pushed a commit to KhafraDev/undici that referenced this issue Jun 23, 2022
* Handle undefined status and statusText

Fixes nodejs#1094, but I'm not 100% sure if deleting the statusText is the nicest way to deal with this as we're mutating the input object.

* Add test, make patch simpler

* Lint fixes

* Improve
metcoder95 pushed a commit to metcoder95/undici that referenced this issue Dec 26, 2022
* Handle undefined status and statusText

Fixes nodejs#1094, but I'm not 100% sure if deleting the statusText is the nicest way to deal with this as we're mutating the input object.

* Add test, make patch simpler

* Lint fixes

* Improve
crysmags pushed a commit to crysmags/undici that referenced this issue Feb 27, 2024
* Handle undefined status and statusText

Fixes nodejs#1094, but I'm not 100% sure if deleting the statusText is the nicest way to deal with this as we're mutating the input object.

* Add test, make patch simpler

* Lint fixes

* Improve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant