diff --git a/doc/api/http.md b/doc/api/http.md index be4642177a73c0..9d7d4b2834f6df 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1107,7 +1107,7 @@ Stops the server from accepting new connections. See [`net.Server.close()`][]. added: v11.3.0 --> -* {number} **Default:** `40000` +* {number} **Default:** `60000` Limit the amount of time the parser will wait to receive the complete HTTP headers. diff --git a/doc/api/https.md b/doc/api/https.md index 1392ecddd55a12..c685b3fe636c5a 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -94,7 +94,7 @@ See [`server.close()`][`http.close()`] from the HTTP module for details. added: v11.3.0 --> -* {number} **Default:** `40000` +* {number} **Default:** `60000` See [`http.Server#headersTimeout`][]. diff --git a/lib/_http_server.js b/lib/_http_server.js index d43c1bfb63d67b..900060d61137dc 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -356,7 +356,7 @@ function Server(options, requestListener) { this.timeout = kDefaultHttpServerTimeout; this.keepAliveTimeout = 5000; this.maxHeadersCount = null; - this.headersTimeout = 40 * 1000; // 40 seconds + this.headersTimeout = 60 * 1000; // 60 seconds } ObjectSetPrototypeOf(Server.prototype, net.Server.prototype); ObjectSetPrototypeOf(Server, net.Server); diff --git a/lib/https.js b/lib/https.js index cc118669e8f517..2253024f92e213 100644 --- a/lib/https.js +++ b/lib/https.js @@ -81,7 +81,7 @@ function Server(opts, requestListener) { this.timeout = kDefaultHttpServerTimeout; this.keepAliveTimeout = 5000; this.maxHeadersCount = null; - this.headersTimeout = 40 * 1000; // 40 seconds + this.headersTimeout = 60 * 1000; // 60 seconds } ObjectSetPrototypeOf(Server.prototype, tls.Server.prototype); ObjectSetPrototypeOf(Server, tls.Server); diff --git a/test/parallel/test-http-slow-headers.js b/test/parallel/test-http-slow-headers.js index 6da11465dac17b..25ee5b63e8c0e2 100644 --- a/test/parallel/test-http-slow-headers.js +++ b/test/parallel/test-http-slow-headers.js @@ -17,8 +17,8 @@ const headers = const server = createServer(common.mustNotCall()); let sendCharEvery = 1000; -// 40 seconds is the default -assert.strictEqual(server.headersTimeout, 40 * 1000); +// 60 seconds is the default +assert.strictEqual(server.headersTimeout, 60 * 1000); // Pass a REAL env variable to shortening up the default // value which is 40s otherwise this is useful for manual diff --git a/test/parallel/test-https-slow-headers.js b/test/parallel/test-https-slow-headers.js index 531d9ad318fa03..95f0caa9878c5e 100644 --- a/test/parallel/test-https-slow-headers.js +++ b/test/parallel/test-https-slow-headers.js @@ -27,8 +27,8 @@ const server = createServer({ let sendCharEvery = 1000; -// 40 seconds is the default -assert.strictEqual(server.headersTimeout, 40 * 1000); +// 60 seconds is the default +assert.strictEqual(server.headersTimeout, 60 * 1000); // Pass a REAL env variable to shortening up the default // value which is 40s otherwise