Skip to content

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

Merged
ok2c merged 1 commit into
apache:masterfrom
ok2c:h2_content_length
Jul 25, 2026
Merged

H2 stream handlers to make sure content-length header value equals the sum of data payload#683
ok2c merged 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.

@arturobernalg

Copy link
Copy Markdown
Member

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.

@ok2c
I do not consider it a critical blocker if it would rather handle it separately.

@arturobernalg arturobernalg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ok2c
ok2c merged commit d019de5 into apache:master Jul 25, 2026
10 checks passed
@ok2c
ok2c deleted the h2_content_length branch July 25, 2026 08:39
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