diff options
author | theanarkh <theratliter@gmail.com> | 2022-07-29 12:00:38 +0300 |
---|---|---|
committer | Juan José Arboleda <soyjuanarbol@gmail.com> | 2022-10-11 22:45:20 +0300 |
commit | 8398e98b1b922db908cc86d5298d0958efe6711e (patch) | |
tree | ea43cf31c4ece5de78abe95558e32dd1973f00b4 /lib | |
parent | 092239a7f1169719fbf39b6802beb4b1a1d3f2ce (diff) |
http: make idle http parser count configurable
PR-URL: https://github.com/nodejs/node/pull/43974
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/http.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/http.js b/lib/http.js index 1366656e42e..d7acafe4f31 100644 --- a/lib/http.js +++ b/lib/http.js @@ -27,9 +27,10 @@ const { ObjectDefineProperty, } = primordials; +const { validateInteger } = require('internal/validators'); const httpAgent = require('_http_agent'); const { ClientRequest } = require('_http_client'); -const { methods } = require('_http_common'); +const { methods, parsers } = require('_http_common'); const { IncomingMessage } = require('_http_incoming'); const { validateHeaderName, @@ -123,7 +124,11 @@ module.exports = { validateHeaderName, validateHeaderValue, get, - request + request, + setMaxIdleHTTPParsers(max) { + validateInteger(max, 'max', 1); + parsers.max = max; + } }; ObjectDefineProperty(module.exports, 'maxHeaderSize', { |