Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Content-Length not checked by http protocol #2385

Open
hostilefork opened this issue Sep 15, 2019 · 0 comments
Open

Content-Length not checked by http protocol #2385

hostilefork opened this issue Sep 15, 2019 · 0 comments

Comments

@hostilefork
Copy link
Member

The http protocol does not honor the Content-Length header field, and instead reads data as much data as a socket provides. This was discovered when the httpd.reb server was using length of a string in codepoints for the Content-Length, instead of the length of the binary encoded UTF-8.

So for instance, the header claimed a content length of 19 when serving the string HighCodepointCat(😺), which is actually 22 bytes in size. However the HTTP read received the full 22 bytes:

>> data: read http://127.0.0.1:8000 
== #{48696768436F6465706F696E7443617428F09F98BA29}

>> length? data
== 22
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant