Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
nicksia-vgw committed Aug 7, 2022
commit 9dde596ed06f0873289992f3e69a57155145f28e
2 changes: 1 addition & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down