Skip to content

Characters with more than one byte of data cause a bad request #132

@corymharper

Description

@corymharper

Take the following:

'☺'.length; // -> 1

new TextEncoder().encode('☺').byteLength; // -> 3

The smiley character has a length of one, but uses three bytes of memory. In the current implementation we calculate the Content-Length header using the length of the string, and for most characters that works, but there are some special characters that use multiple bytes of memory, this makes the header not match the actual amount of information passed, which causes a bad request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions