Skip to content

H2 stream handlers to make sure content-length header value equals the sum of data payload#683

Open
ok2c wants to merge 1 commit into
apache:masterfrom
ok2c:h2_content_length
Open

H2 stream handlers to make sure content-length header value equals the sum of data payload#683
ok2c wants to merge 1 commit into
apache:masterfrom
ok2c:h2_content_length

Conversation

@ok2c

@ok2c ok2c commented Jul 23, 2026

Copy link
Copy Markdown
Member

H2 stream handlers to make sure content-length header value equals the sum of data payload.

Conformance to RFC 9113, section 8.1.1

…e sum of data payload as per RFC 9113, section 8.1.1
@ok2c
ok2c requested a review from arturobernalg July 23, 2026 11:27
@arturobernalg

Copy link
Copy Markdown
Member

@ok2c
Shouldn't the content length also be validated when trailer HEADERS terminate the stream? RFC 9113 §8.1 states that trailer fields are carried in a field block that terminates the stream, while §8.1.1 requires Content-Length to equal the sum of the DATA frame payload lengths.

@ok2c

ok2c commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

Shouldn't the content length also be validated when trailer HEADERS terminate the stream? RFC 9113 §8.1 states that trailer fields are carried in a field block that terminates the stream, while §8.1.1 requires Content-Length to equal the sum of the DATA frame payload lengths.

@arturobernalg I honestly do not know. Do you think it should? If you do, I will update the change-set. As far as I can tell, in practical terms this check matters for message head only due to a possible H2 to HTTP/1.1 translation by an intermediary.

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.

2 participants