Skip to content

Commit

Permalink
http: fix error message when specifying headerTimeout for createServer
Browse files Browse the repository at this point in the history
This change fixes the message on the error received when calling
http.createServer(...) with a header timeout greater than the request
timeout is incorrect.

The validation requires that the header timeout is lower than the
request timeout, but the error message asks for the opposite.

PR-URL: nodejs#44163
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
  • Loading branch information
nicksia-vgw authored and Fyko committed Sep 15, 2022
1 parent 59c0ce9 commit fdc7e57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ function storeHTTPOptions(options) {
}

if (this.requestTimeout > 0 && this.headersTimeout > 0 && this.headersTimeout >= this.requestTimeout) {
throw new codes.ERR_OUT_OF_RANGE('headersTimeout', '>= requestTimeout', headersTimeout);
throw new codes.ERR_OUT_OF_RANGE('headersTimeout', '< requestTimeout', headersTimeout);
}

const keepAliveTimeout = options.keepAliveTimeout;
Expand Down

0 comments on commit fdc7e57

Please sign in to comment.