Skip to content

AsyncRead + !AsyncSeek sized response body? #2415

Answered by SergioBenitez
dnbln asked this question in Questions
Discussion options

You must be logged in to vote

No, it is not possible as this would allow for trivially creating "sized" bodies with sizes that don't correspond to the actual body size, confusing clients, violating the HTTP spec, and potentially causing all sorts of security issues. From RFC9110:

Because Content-Length is used for message delimitation in HTTP/1.1, its field value can impact how the message is parsed by downstream recipients even when the immediate connection is not using HTTP/1.1. If the message is forwarded by a downstream intermediary, a Content-Length field value that is inconsistent with the received message framing might cause a security failure due to request smuggling or response splitting.

As a result, a send…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dnbln
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants