Skip to content

Commit b427924

Browse files
authored
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 <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Erick Wendel <[email protected]> Reviewed-By: Ricky Zhou <[email protected]>
1 parent 8b0e5b1 commit b427924

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/_http_server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ function storeHTTPOptions(options) {
420420
}
421421

422422
if (this.requestTimeout > 0 && this.headersTimeout > 0 && this.headersTimeout >= this.requestTimeout) {
423-
throw new codes.ERR_OUT_OF_RANGE('headersTimeout', '>= requestTimeout', headersTimeout);
423+
throw new codes.ERR_OUT_OF_RANGE('headersTimeout', '< requestTimeout', headersTimeout);
424424
}
425425

426426
const keepAliveTimeout = options.keepAliveTimeout;

0 commit comments

Comments
 (0)