You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ServerResponse.write throws an exception when passing a Uint8array. #33379
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)
Activity
addaleax commentedon May 12, 2020
This is being fixed by #33155 :)
bordoley commentedon May 12, 2020
@addaleax ah thanks, sorry for the dupe. poked around the bugs but didn't check pull requests.
http: don't throw on `Uint8Array`s for `http.ServerResponse#write`
http: don't throw on `Uint8Array`s for `http.ServerResponse#write`
http: don't throw on `Uint8Array`s for `http.ServerResponse#write`
http: don't throw on `Uint8Array`s for `http.ServerResponse#write`
http: don't throw on `Uint8Array`s for `http.ServerResponse#write`