http: add maxHeaderSize property

This commit exposes the value of --max-http-header-size
as a property of the http module.

PR-URL: https://github.com/nodejs/node/pull/24860
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
cjihrig 2018-12-05 19:59:12 -05:00
parent f0e460968e
commit 9ac108d834
No known key found for this signature in database
GPG key ID: 7434390BDBE9B9C5
3 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,11 @@
'use strict';
require('../common');
const assert = require('assert');
const { spawnSync } = require('child_process');
const http = require('http');
assert.strictEqual(http.maxHeaderSize, 8 * 1024);
const child = spawnSync(process.execPath, ['--max-http-header-size=10', '-p',
'http.maxHeaderSize']);
assert.strictEqual(+child.stdout.toString().trim(), 10);