Skip to content

Correct padded HEADERS length and reject padding over fixed fields - #170

Open
vitalivo wants to merge 1 commit into
python-hyper:masterfrom
vitalivo:fix/padded-header-lengths
Open

Correct padded HEADERS length and reject padding over fixed fields#170
vitalivo wants to merge 1 commit into
python-hyper:masterfrom
vitalivo:fix/padded-header-lengths

Conversation

@vitalivo

Copy link
Copy Markdown

Parsing a padded HEADERS frame drops the pad-length byte from body_len. This also rejects a valid frame containing only padding and an empty header block. Separately, HEADERS with PRIORITY and PUSH_PROMISE can accept padding that overlaps their fixed fields.

Keep the full HEADERS body length and compare padding against the bytes available after the fixed fields. Regression cases cover zero/nonzero padding, empty/nonempty header blocks, both priority modes, and overlapping fixed fields in both frame types.

All 14 regression cases fail before the fix. Full Python 3.12 suite: 162 passed, 100% branch coverage. Ruff and strict mypy pass. Includes a changelog entry.

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.

1 participant