Skip to content

Document how :max_header_list_size limits are enforced - #532

Open
ericmj wants to merge 1 commit into
http2-header-block-boundfrom
http2-header-list-size-docs
Open

ericmj wants to merge 1 commit into
http2-header-block-boundfrom
http2-header-list-size-docs

Conversation

@ericmj

@ericmj ericmj commented Oct 16, 2026

Copy link
Copy Markdown
Member

The docs said a header block larger than :max_header_list_size closes the connection. A decoded response header list over the limit resets the request with a PROTOCOL_ERROR stream error and returns a {:max_header_list_size_exceeded, size, max_size} error, and promised request headers over the limit reset the promised stream with REFUSED_STREAM. The connection stays open in both cases.

Only the header block fragments buffered while waiting for END_HEADERS are a connection error, when they're over an upper bound on the encoded size of a header list within the limit. The fragment that carries END_HEADERS isn't counted, and the complete block is then judged by its decoded size.

The docs also say that the server setting is :infinity until the server sends it, and that the client setting must be an integer, since put_settings/2 and the :client_settings option raise on :infinity.

The docs said a header block larger than :max_header_list_size closes
the connection. A decoded response header list over the limit resets the
request with a PROTOCOL_ERROR stream error and returns a
{:max_header_list_size_exceeded, size, max_size} error, and promised
request headers over the limit reset the promised stream with
REFUSED_STREAM. The connection stays open in both cases.

Only the header block fragments buffered while waiting for END_HEADERS
are a connection error, when they're over an upper bound on the encoded
size of a header list within the limit. The fragment that carries
END_HEADERS isn't counted, and the complete block is then judged by its
decoded size.

The docs also say that the server setting is :infinity until the server
sends it, and that the client setting must be an integer, since
put_settings/2 and the :client_settings option raise on :infinity.
@github-actions

Copy link
Copy Markdown

Coverage Report for CI Build 338

Coverage decreased (-0.1%) to 90.426%

Details

  • Coverage decreased (-0.1%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 3 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

3 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
lib/mint/http2.ex 2 95.31%
lib/mint/http1.ex 1 87.11%

Coverage Stats

Coverage Status
Relevant Lines: 1974
Covered Lines: 1785
Line Coverage: 90.43%
Coverage Strength: 713.78 hits per line

馃挍 - Coveralls

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