Skip to content

test: cover HTTP/2 decoded header name accounting - #1657

Open
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:test/hpack-decoded-header-name-accounting
Open

He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:test/hpack-decoded-header-name-accounting

Conversation

@He-Pin

@He-Pin He-Pin commented Nov 26, 2026

Copy link
Copy Markdown
Member

Motivation

The local decompressed header limit already counts a field's name once, but the existing request test stays comfortably below that limit.

Modification

Add a focused HTTP/2 request-parsing test. Decode a complete GET with two ASCII extension fields at its exact local name-plus-value limit and check that both fields reach the request.

Result

This test protects the existing accounting without changing production code or the advertised HTTP/2 field section size.

References

Tests

  • Added RequestParsingSpec case: 1 passed on each of Scala 2.13.18 and 3.3.9 with JDK 17.
  • Scala format and license header checks passed for the HTTP/2 test project.

Motivation
The decompressed header limit has coverage below the limit but not for
where counting a field name twice would reject an ordinary request.

Modification
Decode a complete HTTP/2 request with two extension fields using the
exact local name-plus-value budget, and assert both fields are retained.

Result
The native suite protects the existing local accounting behavior without
changing the advertised HTTP/2 setting or production code.

References
Netty HpackDecoderTest.testDecodeCountsNamesOnlyOnce; RFC 9113 §6.5.2.

Tests
RequestParsingSpec on Scala 2.13.18 and 3.3.9; Scala format and header checks.
@He-Pin
He-Pin requested a review from pjfanning November 26, 2026 08:48

@pjfanning pjfanning 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.

Nit: it only checks the accepting side at the exact limit, so it would also pass if names weren't counted at all. Adding a rejection case at fieldBytes - 1 would make "counted once" two-sided.

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