Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http,https: increase server headers timeout #30071

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/api/http.md
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion doc/api/https.md
Expand Up @@ -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`][].

Expand Down
2 changes: 1 addition & 1 deletion lib/_http_server.js
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/https.js
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-http-slow-headers.js
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-https-slow-headers.js
Expand Up @@ -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
Expand Down