Skip to content

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

Closed
@bordoley

Description

@bordoley

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    httpIssues or PRs related to the http subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions