From b4279240f5733ef8710c8d43a2bdcb0ec409eb49 Mon Sep 17 00:00:00 2001 From: Nick Sia <31839263+nicksia-vgw@users.noreply.github.com> Date: Tue, 9 Aug 2022 17:27:18 +0800 Subject: [PATCH] http: fix error message when specifying headerTimeout for createServer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/44163 Reviewed-By: Paolo Insogna Reviewed-By: Matteo Collina Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen Reviewed-By: Erick Wendel Reviewed-By: Ricky Zhou <0x19951125@gmail.com> --- 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 a2eba953cfc..5f54295c8a1 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -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;