• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2require('../common');
3const assert = require('assert');
4const { spawnSync } = require('child_process');
5
6// The last option on the command line takes precedence:
7assert.strictEqual(spawnSync(process.execPath, [
8  '--max-http-header-size=1234',
9  '--max-http-header-size=5678',
10  '-p', 'http.maxHeaderSize',
11], {
12  encoding: 'utf8'
13}).stdout.trim(), '5678');
14
15// The command line takes precedence over NODE_OPTIONS:
16assert.strictEqual(spawnSync(process.execPath, [
17  '--max-http-header-size=5678',
18  '-p', 'http.maxHeaderSize',
19], {
20  encoding: 'utf8',
21  env: { ...process.env, NODE_OPTIONS: '--max-http-header-size=1234' }
22}).stdout.trim(), '5678');
23