GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — http: increase default header size from 8KB to 16KB · nodejs/node@bd9f4d2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc
    • api
      • cli.md
      • http.md
    • node.1
  • src
    • node_options.cc
    • node_options.h
  • test/parallel
    • test-http-max-header-size.js
    • test-http-max-http-headers.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/cli.md‎

Copy file name to clipboardExpand all lines: doc/api/cli.md
+5-1Lines changed: 5 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,13 @@ disappear in a non-semver-major release.
440440
### `--max-http-header-size=size`
441441
<!-- YAML
442442
added: v11.6.0
443+
changes:
444+
- version: REPLACEME
445+
pr-url: https://github.com/nodejs/node/pull/32520
446+
description: Change maximum default size of HTTP headers from 8KB to 16KB.
443447
-->
444448

445-
Specify the maximum size, in bytes, of HTTP headers. Defaults to 8KB.
449+
Specify the maximum size, in bytes, of HTTP headers. Defaults to 16KB.
446450

447451
### `--napi-modules`
448452
<!-- YAML
Collapse file

‎doc/api/http.md‎

Copy file name to clipboardExpand all lines: doc/api/http.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2059,7 +2059,7 @@ changes:
20592059
* `maxHeaderSize` {number} Optionally overrides the value of
20602060
[`--max-http-header-size`][] for requests received by this server, i.e.
20612061
the maximum length of request headers in bytes.
2062-
**Default:** 8192 (8KB).
2062+
**Default:** 16384 (16KB).
20632063
* `requestListener` {Function}
20642064

20652065
* Returns: {http.Server}
@@ -2213,7 +2213,7 @@ changes:
22132213
* `maxHeaderSize` {number} Optionally overrides the value of
22142214
[`--max-http-header-size`][] for requests received from the server, i.e.
22152215
the maximum length of response headers in bytes.
2216-
**Default:** 8192 (8KB).
2216+
**Default:** 16384 (16KB).
22172217
* `method` {string} A string specifying the HTTP request method. **Default:**
22182218
`'GET'`.
22192219
* `path` {string} Request path. Should include query string if any.
Collapse file

‎doc/node.1‎

Copy file name to clipboardExpand all lines: doc/node.1
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ This flag is inherited from V8 and is subject to change upstream. It may
244244
disappear in a non-semver-major release.
245245
.
246246
.It Fl -max-http-header-size Ns = Ns Ar size
247-
Specify the maximum size of HTTP headers in bytes. Defaults to 8KB.
247+
Specify the maximum size of HTTP headers in bytes. Defaults to 16KB.
248248
.
249249
.It Fl -napi-modules
250250
This option is a no-op.
Collapse file

‎src/node_options.cc‎

Copy file name to clipboardExpand all lines: src/node_options.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
422422
&EnvironmentOptions::heap_prof_interval);
423423
#endif // HAVE_INSPECTOR
424424
AddOption("--max-http-header-size",
425-
"set the maximum size of HTTP headers (default: 8192 (8KB))",
425+
"set the maximum size of HTTP headers (default: 16384 (16KB))",
426426
&EnvironmentOptions::max_http_header_size,
427427
kAllowedInEnvironment);
428428
AddOption("--redirect-warnings",
Collapse file

‎src/node_options.h‎

Copy file name to clipboardExpand all lines: src/node_options.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class EnvironmentOptions : public Options {
116116
bool expose_internals = false;
117117
bool frozen_intrinsics = false;
118118
std::string heap_snapshot_signal;
119-
uint64_t max_http_header_size = 8 * 1024;
119+
uint64_t max_http_header_size = 16 * 1024;
120120
bool no_deprecation = false;
121121
bool no_force_async_hooks_checks = false;
122122
bool no_warnings = false;
Collapse file

‎test/parallel/test-http-max-header-size.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-max-header-size.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const assert = require('assert');
55
const { spawnSync } = require('child_process');
66
const http = require('http');
77

8-
assert.strictEqual(http.maxHeaderSize, 8 * 1024);
8+
assert.strictEqual(http.maxHeaderSize, 16 * 1024);
99
const child = spawnSync(process.execPath, ['--max-http-header-size=10', '-p',
1010
'http.maxHeaderSize']);
1111
assert.strictEqual(+child.stdout.toString().trim(), 10);
Collapse file

‎test/parallel/test-http-max-http-headers.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-max-http-headers.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ const common = require('../common');
44
const assert = require('assert');
55
const http = require('http');
66
const net = require('net');
7-
const MAX = +(process.argv[2] || 8 * 1024); // Command line option, or 8KB.
7+
const MAX = +(process.argv[2] || 16 * 1024); // Command line option, or 16KB.
88

99
const { getOptionValue } = require('internal/options');
1010

1111
console.log('pid is', process.pid);
1212
console.log('max header size is', getOptionValue('--max-http-header-size'));
1313

14-
// Verify that we cannot receive more than 8KB of headers.
14+
// Verify that we cannot receive more than 16KB of headers.
1515

1616
function once(cb) {
1717
let called = false;

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.