GeezerVison is showing github.com — http: increase default header size from 8KB to 16KB · nodejs/node@bd9f4d2
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -440,9 +440,13 @@ disappear in a non-semver-major release. | 440 | 440 | ### `--max-http-header-size=size` | 441 | 441 | <!-- YAML | 442 | 442 | 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. | 443 | 447 | --> | 444 | 448 |
| 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. | 446 | 450 |
| 447 | 451 | ### `--napi-modules` | 448 | 452 | <!-- YAML | |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -2059,7 +2059,7 @@ changes: | 2059 | 2059 | * `maxHeaderSize` {number} Optionally overrides the value of | 2060 | 2060 | [`--max-http-header-size`][] for requests received by this server, i.e. | 2061 | 2061 | the maximum length of request headers in bytes. | 2062 | | - **Default:** 8192 (8KB). | | 2062 | + **Default:** 16384 (16KB). | 2063 | 2063 | * `requestListener` {Function} | 2064 | 2064 |
| 2065 | 2065 | * Returns: {http.Server} | @@ -2213,7 +2213,7 @@ changes: | 2213 | 2213 | * `maxHeaderSize` {number} Optionally overrides the value of | 2214 | 2214 | [`--max-http-header-size`][] for requests received from the server, i.e. | 2215 | 2215 | the maximum length of response headers in bytes. | 2216 | | - **Default:** 8192 (8KB). | | 2216 | + **Default:** 16384 (16KB). | 2217 | 2217 | * `method` {string} A string specifying the HTTP request method. **Default:** | 2218 | 2218 | `'GET'`. | 2219 | 2219 | * `path` {string} Request path. Should include query string if any. | |
Collapse file Copy file name to clipboardExpand all lines: doc/node.1 +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -244,7 +244,7 @@ This flag is inherited from V8 and is subject to change upstream. It may | 244 | 244 | disappear in a non-semver-major release. | 245 | 245 | . | 246 | 246 | .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. | 248 | 248 | . | 249 | 249 | .It Fl -napi-modules | 250 | 250 | This option is a no-op. | |
Collapse file Copy file name to clipboardExpand all lines: src/node_options.cc +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -422,7 +422,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { | 422 | 422 | &EnvironmentOptions::heap_prof_interval); | 423 | 423 | #endif // HAVE_INSPECTOR | 424 | 424 | 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))", | 426 | 426 | &EnvironmentOptions::max_http_header_size, | 427 | 427 | kAllowedInEnvironment); | 428 | 428 | AddOption("--redirect-warnings", | |
Collapse file Copy file name to clipboardExpand all lines: src/node_options.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -116,7 +116,7 @@ class EnvironmentOptions : public Options { | 116 | 116 | bool expose_internals = false; | 117 | 117 | bool frozen_intrinsics = false; | 118 | 118 | std::string heap_snapshot_signal; | 119 | | - uint64_t max_http_header_size = 8 * 1024; | | 119 | + uint64_t max_http_header_size = 16 * 1024; | 120 | 120 | bool no_deprecation = false; | 121 | 121 | bool no_force_async_hooks_checks = false; | 122 | 122 | bool no_warnings = false; | |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,7 @@ const assert = require('assert'); | 5 | 5 | const { spawnSync } = require('child_process'); | 6 | 6 | const http = require('http'); | 7 | 7 |
| 8 | | -assert.strictEqual(http.maxHeaderSize, 8 * 1024); | | 8 | +assert.strictEqual(http.maxHeaderSize, 16 * 1024); | 9 | 9 | const child = spawnSync(process.execPath, ['--max-http-header-size=10', '-p', | 10 | 10 | 'http.maxHeaderSize']); | 11 | 11 | assert.strictEqual(+child.stdout.toString().trim(), 10); |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -4,14 +4,14 @@ const common = require('../common'); | 4 | 4 | const assert = require('assert'); | 5 | 5 | const http = require('http'); | 6 | 6 | 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. | 8 | 8 |
| 9 | 9 | const { getOptionValue } = require('internal/options'); | 10 | 10 |
| 11 | 11 | console.log('pid is', process.pid); | 12 | 12 | console.log('max header size is', getOptionValue('--max-http-header-size')); | 13 | 13 |
| 14 | | -// Verify that we cannot receive more than 8KB of headers. | | 14 | +// Verify that we cannot receive more than 16KB of headers. | 15 | 15 |
| 16 | 16 | function once(cb) { | 17 | 17 | let called = false; | |
|