mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
http: do not override user-provided options object
PR-URL: https://github.com/nodejs/node/pull/33633 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
7a216d5fd6
commit
c925039b35
3 changed files with 49 additions and 9 deletions
14
test/parallel/test-http-client-insecure-http-parser-error.js
Normal file
14
test/parallel/test-http-client-insecure-http-parser-error.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
require('../common');
|
||||
const assert = require('assert');
|
||||
const ClientRequest = require('http').ClientRequest;
|
||||
|
||||
{
|
||||
assert.throws(() => {
|
||||
new ClientRequest({ insecureHTTPParser: 'wrongValue' });
|
||||
}, {
|
||||
code: 'ERR_INVALID_ARG_TYPE',
|
||||
message: /insecureHTTPParser/
|
||||
}, 'http request should throw when passing invalid insecureHTTPParser');
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue