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

ServerResponse.write throws an exception when passing a Uint8array. #33379

Closed
bordoley opened this issue May 12, 2020 · 2 comments
Closed

ServerResponse.write throws an exception when passing a Uint8array. #33379

bordoley opened this issue May 12, 2020 · 2 comments
Labels
http Issues or PRs related to the http subsystem.

Comments

@bordoley
Copy link

Tested on node v14.0.0 using an http1 server calling ServerResponse.write with a UInt8array instance received the following exception. According to the buffer docs, I would expect the api to accept UInt8array as well.

"TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer. Received an instance of Uint8Array
at write_ (_http_outgoing.js:679:11)
at ServerResponse.write (_http_outgoing.js:644:15)

@addaleax addaleax added the http Issues or PRs related to the http subsystem. label May 12, 2020
@addaleax
Copy link
Member

This is being fixed by #33155 :)

@bordoley
Copy link
Author

@addaleax ah thanks, sorry for the dupe. poked around the bugs but didn't check pull requests.

@targos targos closed this as completed in 2b50cd7 May 16, 2020
rexagod added a commit to rexagod/node that referenced this issue May 20, 2020
Don't throw errors on Uint8Arrays and added test for all
valid types.

Backport-PR-URL: nodejs#33488
PR-URL: nodejs#33155
Fixes: nodejs#33379
Refs: nodejs#29829
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
rexagod added a commit to rexagod/node that referenced this issue May 20, 2020
Don't throw errors on Uint8Arrays and added test for all
valid types.

Backport-PR-URL: nodejs#33490
PR-URL: nodejs#33155
Fixes: nodejs#33379
Refs: nodejs#29829
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
codebytere pushed a commit that referenced this issue Jun 27, 2020
Don't throw errors on Uint8Arrays and added test for all
valid types.

Backport-PR-URL: #33490
PR-URL: #33155
Fixes: #33379
Refs: #29829
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
codebytere pushed a commit that referenced this issue Jun 30, 2020
Don't throw errors on Uint8Arrays and added test for all
valid types.

Backport-PR-URL: #33490
PR-URL: #33155
Fixes: #33379
Refs: #29829
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this issue Aug 18, 2020
Don't throw errors on Uint8Arrays and added test for all
valid types.

Backport-PR-URL: #33488
PR-URL: #33155
Fixes: #33379
Refs: #29829
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants