Skip to content

doc: fix default value for maxHeadersCount in http.md - #65541

Closed
santusht06 wants to merge 1 commit into
nodejs:mainfrom
santusht06:doc-fix-max-headers-count-default
Closed

doc: fix default value for maxHeadersCount in http.md#65541
santusht06 wants to merge 1 commit into
nodejs:mainfrom
santusht06:doc-fix-max-headers-count-default

Conversation

@santusht06

Copy link
Copy Markdown

The documentation previously stated that the default for server.maxHeadersCount and request.maxHeadersCount was 2000.

However, MAX_HEADER_PAIRS in lib/_http_common.js limits the parser's header pairs array (alternating header name and value strings) to 2000. Because each incoming HTTP header consumes two array elements, the actual default limit is 1000 headers before returning 431 Request Header Fields Too Large.

Changes

  • Updated server.maxHeadersCount default from 2000 to 1000 in doc/api/http.md.
  • Updated request.maxHeadersCount default from 2000 to 1000 in doc/api/http.md.

Fixes: #65470

The documentation previously stated that the default for
`server.maxHeadersCount` and `request.maxHeadersCount` was 2000.
However, `MAX_HEADER_PAIRS` in `lib/_http_common.js` limits parser
pairs (header name and value strings) to 2000, which corresponds to
an effective default limit of 1000 headers.

Fixes: nodejs#65470
Signed-off-by: Santusht kotai <115890693+santusht06@users.noreply.github.com>
@santusht06
santusht06 force-pushed the doc-fix-max-headers-count-default branch from 2e3e5a1 to 0bf1e5d Compare August 25, 2026 12:27
@santusht06

Copy link
Copy Markdown
Author

Issue #65470 has landed upstream in commit 056e2ae via PR #65472. Closing duplicate.

@santusht06 santusht06 closed this Aug 25, 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.

Stated server.maxHeadersCount default is off by a factor of two

1 participant