Skip to content

Commit 7a907d7

Browse files
committed
http,https: increase server headers timeout
Fixes: nodejs#24980 Refs: nodejs@eb43bc04b1
1 parent 4187fcb commit 7a907d7

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

doc/api/http.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ Stops the server from accepting new connections. See [`net.Server.close()`][].
10641064
added: v11.3.0
10651065
-->
10661066

1067-
* {number} **Default:** `40000`
1067+
* {number} **Default:** `60000`
10681068

10691069
Limit the amount of time the parser will wait to receive the complete HTTP
10701070
headers.

doc/api/https.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ See [`server.close()`][`http.close()`] from the HTTP module for details.
6969
added: v11.3.0
7070
-->
7171

72-
* {number} **Default:** `40000`
72+
* {number} **Default:** `60000`
7373

7474
See [`http.Server#headersTimeout`][].
7575

lib/_http_server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ function Server(options, requestListener) {
335335
this.timeout = 0;
336336
this.keepAliveTimeout = 5000;
337337
this.maxHeadersCount = null;
338-
this.headersTimeout = 40 * 1000; // 40 seconds
338+
this.headersTimeout = 60 * 1000; // 60 seconds
339339
}
340340
Object.setPrototypeOf(Server.prototype, net.Server.prototype);
341341
Object.setPrototypeOf(Server, net.Server);

lib/https.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function Server(opts, requestListener) {
7474
this.timeout = 0;
7575
this.keepAliveTimeout = 5000;
7676
this.maxHeadersCount = null;
77-
this.headersTimeout = 40 * 1000; // 40 seconds
77+
this.headersTimeout = 60 * 1000; // 60 seconds
7878
}
7979
Object.setPrototypeOf(Server.prototype, tls.Server.prototype);
8080
Object.setPrototypeOf(Server, tls.Server);

test/parallel/test-http-slow-headers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ const headers =
1717
const server = createServer(common.mustNotCall());
1818
let sendCharEvery = 1000;
1919

20-
// 40 seconds is the default
21-
assert.strictEqual(server.headersTimeout, 40 * 1000);
20+
// 60 seconds is the default
21+
assert.strictEqual(server.headersTimeout, 60 * 1000);
2222

2323
// Pass a REAL env variable to shortening up the default
2424
// value which is 40s otherwise this is useful for manual

test/parallel/test-https-slow-headers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const server = createServer({
2727

2828
let sendCharEvery = 1000;
2929

30-
// 40 seconds is the default
31-
assert.strictEqual(server.headersTimeout, 40 * 1000);
30+
// 60 seconds is the default
31+
assert.strictEqual(server.headersTimeout, 60 * 1000);
3232

3333
// Pass a REAL env variable to shortening up the default
3434
// value which is 40s otherwise

0 commit comments

Comments
 (0)