Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/api/cli.md6
-rw-r--r--doc/api/http.md4
-rw-r--r--doc/node.12
-rw-r--r--src/node_options.cc2
-rw-r--r--src/node_options.h2
-rw-r--r--test/parallel/test-http-max-header-size.js2
-rw-r--r--test/parallel/test-http-max-http-headers.js4
7 files changed, 13 insertions, 9 deletions
diff --git a/doc/api/cli.md b/doc/api/cli.md
index cd7e8519717..386d9cdb96e 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -440,9 +440,13 @@ disappear in a non-semver-major release.
### `--max-http-header-size=size`
<!-- YAML
added: v11.6.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/32520
+ description: Change maximum default size of HTTP headers from 8KB to 16KB.
-->
-Specify the maximum size, in bytes, of HTTP headers. Defaults to 8KB.
+Specify the maximum size, in bytes, of HTTP headers. Defaults to 16KB.
### `--napi-modules`
<!-- YAML
diff --git a/doc/api/http.md b/doc/api/http.md
index 3b45a36546d..fb2f2b32399 100644
--- a/doc/api/http.md
+++ b/doc/api/http.md
@@ -2059,7 +2059,7 @@ changes:
* `maxHeaderSize` {number} Optionally overrides the value of
[`--max-http-header-size`][] for requests received by this server, i.e.
the maximum length of request headers in bytes.
- **Default:** 8192 (8KB).
+ **Default:** 16384 (16KB).
* `requestListener` {Function}
* Returns: {http.Server}
@@ -2213,7 +2213,7 @@ changes:
* `maxHeaderSize` {number} Optionally overrides the value of
[`--max-http-header-size`][] for requests received from the server, i.e.
the maximum length of response headers in bytes.
- **Default:** 8192 (8KB).
+ **Default:** 16384 (16KB).
* `method` {string} A string specifying the HTTP request method. **Default:**
`'GET'`.
* `path` {string} Request path. Should include query string if any.
diff --git a/doc/node.1 b/doc/node.1
index 430efa77233..9bb344fdf27 100644
--- a/doc/node.1
+++ b/doc/node.1
@@ -244,7 +244,7 @@ This flag is inherited from V8 and is subject to change upstream. It may
disappear in a non-semver-major release.
.
.It Fl -max-http-header-size Ns = Ns Ar size
-Specify the maximum size of HTTP headers in bytes. Defaults to 8KB.
+Specify the maximum size of HTTP headers in bytes. Defaults to 16KB.
.
.It Fl -napi-modules
This option is a no-op.
diff --git a/src/node_options.cc b/src/node_options.cc
index f134d4a735f..7245cd252ba 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -422,7 +422,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
&EnvironmentOptions::heap_prof_interval);
#endif // HAVE_INSPECTOR
AddOption("--max-http-header-size",
- "set the maximum size of HTTP headers (default: 8192 (8KB))",
+ "set the maximum size of HTTP headers (default: 16384 (16KB))",
&EnvironmentOptions::max_http_header_size,
kAllowedInEnvironment);
AddOption("--redirect-warnings",
diff --git a/src/node_options.h b/src/node_options.h
index cffc06beb8c..8c120b0b0a6 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -116,7 +116,7 @@ class EnvironmentOptions : public Options {
bool expose_internals = false;
bool frozen_intrinsics = false;
std::string heap_snapshot_signal;
- uint64_t max_http_header_size = 8 * 1024;
+ uint64_t max_http_header_size = 16 * 1024;
bool no_deprecation = false;
bool no_force_async_hooks_checks = false;
bool no_warnings = false;
diff --git a/test/parallel/test-http-max-header-size.js b/test/parallel/test-http-max-header-size.js
index 07fbe902963..53bd58c4f17 100644
--- a/test/parallel/test-http-max-header-size.js
+++ b/test/parallel/test-http-max-header-size.js
@@ -5,7 +5,7 @@ const assert = require('assert');
const { spawnSync } = require('child_process');
const http = require('http');
-assert.strictEqual(http.maxHeaderSize, 8 * 1024);
+assert.strictEqual(http.maxHeaderSize, 16 * 1024);
const child = spawnSync(process.execPath, ['--max-http-header-size=10', '-p',
'http.maxHeaderSize']);
assert.strictEqual(+child.stdout.toString().trim(), 10);
diff --git a/test/parallel/test-http-max-http-headers.js b/test/parallel/test-http-max-http-headers.js
index 04fdebd48cf..67ecc8c4654 100644
--- a/test/parallel/test-http-max-http-headers.js
+++ b/test/parallel/test-http-max-http-headers.js
@@ -4,14 +4,14 @@ const common = require('../common');
const assert = require('assert');
const http = require('http');
const net = require('net');
-const MAX = +(process.argv[2] || 8 * 1024); // Command line option, or 8KB.
+const MAX = +(process.argv[2] || 16 * 1024); // Command line option, or 16KB.
const { getOptionValue } = require('internal/options');
console.log('pid is', process.pid);
console.log('max header size is', getOptionValue('--max-http-header-size'));
-// Verify that we cannot receive more than 8KB of headers.
+// Verify that we cannot receive more than 16KB of headers.
function once(cb) {
let called = false;