Skip to content

Content length should be based on the byte size of the content#1

Open
ikari7789 wants to merge 1 commit intolivedoor:masterfrom
ikari7789:master
Open

Content length should be based on the byte size of the content#1
ikari7789 wants to merge 1 commit intolivedoor:masterfrom
ikari7789:master

Conversation

@ikari7789
Copy link

Content length should be based on the byte size of the content rather than the string length. When working with UTF-8 data stored in hex notation in $content, length reads the hex values as a single character rather than the full length creating a malformed HTTP response.

For example:
$content = "\x{0100}"
length $content = 1
bytes $content = 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant