Skip to content

Commit f5fcd49

Browse files
nicksia-vgwdanielleadams
authored andcommitted
http: fix error message when specifying headerTimeout for createServer
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: #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>
1 parent c51d85e commit f5fcd49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/_http_server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ function storeHTTPOptions(options) {
425425
}
426426

427427
if (this.requestTimeout > 0 && this.headersTimeout > 0 && this.headersTimeout >= this.requestTimeout) {
428-
throw new codes.ERR_OUT_OF_RANGE('headersTimeout', '>= requestTimeout', headersTimeout);
428+
throw new codes.ERR_OUT_OF_RANGE('headersTimeout', '< requestTimeout', headersTimeout);
429429
}
430430

431431
const keepAliveTimeout = options.keepAliveTimeout;

0 commit comments

Comments
 (0)