http: don't throw on Uint8Arrays for http.ServerResponse#write#33155
http: don't throw on Uint8Arrays for http.ServerResponse#write#33155rexagod wants to merge 2 commits intonodejs:masterfrom
Uint8Arrays for http.ServerResponse#write#33155Conversation
4cf2098 to
7ce222f
Compare
ronag
left a comment
There was a problem hiding this comment.
I would prefer if you tried to make it as similar as possible to what's in Writable.
Also, please try to avoid unrelated whitespace changes.
Http2Server.Response.writeHttp2Server.Response.write
|
Yeah, I think this should also change the HTTP/1 code and leave HTTP/2 alone because that’s already doing the right thing, like #33146 👍 |
|
@addaleax Sorry but I'm confused as to what you are referring to the 'right thing'. If I'm understanding this right, do you want me to remove these type checks for write (in http2), and what should I change in http/1 (since it already has type checks)? |
|
@rexagod Fit the HTTP/1 code so that it also accepts any type of Uint8Array (i.e. replace |
56a56f0 to
b253d17
Compare
|
Thank you so much for clearing this up for me, @addaleax! Sometimes I miss to see the obvious and it's really frustrating! 😅 |
|
@ronag PTAL. I think your comment got resolved. |
83686ad to
fde814e
Compare
|
@ronag Should I remove all changes from outgoing and just commit the test? |
Could you also add a test for the uint8array case? Also please fix the commit msg and PR description. |
3872384 to
33484b2
Compare
dont throw errors on Uint8Arrays and added test for all valid types Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de> fixup: remove dup fixup: remove unused dec fixup: add Uint8Array check in test fixup: don't throw invalid arg error on `Uint8Array`s
Http2Server.Response.writeUint8Arrays for http.ServerResponse#write
|
Landed in 2b50cd7 |
|
@codebytere Yes, it just needs to be applied in a different part of the function that #31818 had moved around (but not really introduced). @rexagod Would you be willing to backport this yourself? The guide for how to do that is in https://github.com/nodejs/node/blob/master/doc/guides/backporting-to-release-lines.md. If you’d prefer, you can also let us know that somebody else should pick that up. |
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>
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>
|
ping @addaleax |
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>
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>
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>
|
The title says http.ServerResponse#write |
Don't throw errors on Uint8Arrays and added test for all valid types. Backport-PR-URL: nodejs/node#33488 PR-URL: nodejs/node#33155 Fixes: nodejs/node#33379 Refs: nodejs/node#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>
Same as #33146 but for
writeRefs: #29829
Fixes: #33379
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes