Skip to content

fix(httpv2)!: frame Length counts the 9-octet header, so RFC 9113 frames are rejected #1121

Closed

Description

@JarryShaw

Describe the bug
httpv2.py:367 writes Length as _make_http_length(...) + 9, and httpv2.py:298 reads it back the same way. RFC 9113 §4.1 excludes the 9-octet frame header from Length.

Separately, httpv2.py:637 checks PRIORITY against != 9, while sibling frames check payload + 9 (RST_STREAM checks 13). So pcapkit rejects even its own PRIORITY frame, whose Length is 14.

Reproduction

  • An RFC-conformant PRIORITY frame (Length=5) raises ProtocolError.
  • An RFC-conformant RST_STREAM frame (Length=4) raises ProtocolError.
  • make_samples.py leaves out httpv2-frame/PRIORITY.

Expected behavior
Length excludes the frame header on both read and write, with the per-frame constants derived from that.

This is breaking: it changes the bytes make() produces, and which captures parse.

System information
main at bdba4fb9d, CPython 3.14.7, Linux.

Additional context
Found by the #1090–#1102 wave's audit and cross-reviews.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    breakingBreaks public-facing behaviour or API (apply alongside the type label)
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 6, 2026
  2. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingBreaks public-facing behaviour or API (apply alongside the type label)fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions