node/test/parallel/test-http-client-insecure-http-parser-error.js
KuthorX c925039b35
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>
2023-12-19 09:55:21 +00:00

15 lines
364 B
JavaScript

'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');
}