mirror of
https://github.com/nodejs/node.git
synced 2025-05-08 01:35:51 +00:00

Refs: https://github.com/nodejs/node/pull/35098#issuecomment-689051526 PR-URL: https://github.com/nodejs/node/pull/35106 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
23 lines
662 B
JavaScript
23 lines
662 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { spawnSync } = require('child_process');
|
|
|
|
// The last option on the command line takes precedence:
|
|
assert.strictEqual(spawnSync(process.execPath, [
|
|
'--max-http-header-size=1234',
|
|
'--max-http-header-size=5678',
|
|
'-p', 'http.maxHeaderSize'
|
|
], {
|
|
encoding: 'utf8'
|
|
}).stdout.trim(), '5678');
|
|
|
|
// The command line takes precedence over NODE_OPTIONS:
|
|
assert.strictEqual(spawnSync(process.execPath, [
|
|
'--max-http-header-size=5678',
|
|
'-p', 'http.maxHeaderSize'
|
|
], {
|
|
encoding: 'utf8',
|
|
env: { ...process.env, NODE_OPTIONS: '--max-http-header-size=1234' }
|
|
}).stdout.trim(), '5678');
|