From 7a907d71314dcc8e2297b690645f58a3acfea12a Mon Sep 17 00:00:00 2001 From: Tim Costa Date: Tue, 22 Oct 2019 18:17:03 -0400 Subject: [PATCH] http,https: increase server headers timeout Fixes: https://github.com/nodejs/node/issues/24980 Refs: https://github.com/nodejs/node/commit/eb43bc04b1 --- doc/api/http.md | 2 +- doc/api/https.md | 2 +- lib/_http_server.js | 2 +- lib/https.js | 2 +- test/parallel/test-http-slow-headers.js | 4 ++-- test/parallel/test-https-slow-headers.js | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index 0807cc09d08b58..e9b8cb2097a421 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1064,7 +1064,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 0d8f859e9c7517..e73116b70156df 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -69,7 +69,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 82f9b91795d8a0..6f15224483be84 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -335,7 +335,7 @@ function Server(options, requestListener) { this.timeout = 0; this.keepAliveTimeout = 5000; this.maxHeadersCount = null; - this.headersTimeout = 40 * 1000; // 40 seconds + this.headersTimeout = 60 * 1000; // 60 seconds } Object.setPrototypeOf(Server.prototype, net.Server.prototype); Object.setPrototypeOf(Server, net.Server); diff --git a/lib/https.js b/lib/https.js index e1fc91fd966ad9..b80723f3ab0cc5 100644 --- a/lib/https.js +++ b/lib/https.js @@ -74,7 +74,7 @@ function Server(opts, requestListener) { this.timeout = 0; this.keepAliveTimeout = 5000; this.maxHeadersCount = null; - this.headersTimeout = 40 * 1000; // 40 seconds + this.headersTimeout = 60 * 1000; // 60 seconds } Object.setPrototypeOf(Server.prototype, tls.Server.prototype); Object.setPrototypeOf(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