Skip to content

ServerH2StreamHandler, ClientH2StreamHandler: validate content length in case of the message stream being terminated by trailers - #1539

Merged
ok2c merged 1 commit into
apache:masterfrom
ok2c:h2_content_len_check_consistency
Nov 27, 2026
Merged

ok2c merged 1 commit into
apache:masterfrom
ok2c:h2_content_len_check_consistency

Conversation

@ok2c

@ok2c ok2c commented Nov 27, 2026

Copy link
Copy Markdown
Member

// I am getting old //

This change-set

  1. fixes content length validation in ClientPushH2StreamHandler and ServerH2StreamHandler in case of the message stream being terminated with a HEADERS frame. ClientPushH2StreamHandler is unaffected.
  2. ServerH2StreamHandler terminates the entire connection not just the offending stream for consistency with the behavior of the client side protocol handlers.

The requirements of RFC 9113 section 8.1.1 "Malformed Messages" with regards to content-length field handling apply to HTTP intermediaries only. There is no such requirement for client or server endpoints. I made a mistake introducing such a restriction in the first place. Now that it has made its way into a GA release the least we can do is to be consistent.

… in case of the message stream being terminated by trailers
@ok2c
ok2c requested a review from arturobernalg November 27, 2026 17:42
@ok2c

ok2c commented Nov 27, 2026

Copy link
Copy Markdown
Member Author

@arturobernalg Please double-check

@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 612e37e into apache:master Nov 27, 2026
12 checks passed
@ok2c ok2c added this to the 5.5.1 milestone Nov 28, 2026
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