From 9dde596ed06f0873289992f3e69a57155145f28e Mon Sep 17 00:00:00 2001 From: Nick Sia Date: Sun, 7 Aug 2022 09:54:22 +0800 Subject: [PATCH] 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. --- lib/_http_server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/_http_server.js b/lib/_http_server.js index 6e4147a3ca2050..f5a08d35548745 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -403,7 +403,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;