diff --git a/lib/_http_client.js b/lib/_http_client.js index 2d2e4eeed21915..e5b35bf0ca9162 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -169,7 +169,7 @@ function ClientRequest(input, options, cb) { let method = options.method; const methodIsString = (typeof method === 'string'); if (method !== null && method !== undefined && !methodIsString) { - throw new ERR_INVALID_ARG_TYPE('method', 'string', method); + throw new ERR_INVALID_ARG_TYPE('options.method', 'string', method); } if (methodIsString && method) { @@ -185,7 +185,7 @@ function ClientRequest(input, options, cb) { if (insecureHTTPParser !== undefined && typeof insecureHTTPParser !== 'boolean') { throw new ERR_INVALID_ARG_TYPE( - 'insecureHTTPParser', 'boolean', insecureHTTPParser); + 'options.insecureHTTPParser', 'boolean', insecureHTTPParser); } this.insecureHTTPParser = insecureHTTPParser; diff --git a/lib/_http_server.js b/lib/_http_server.js index 9a7d23844cb535..02fa95e304b247 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -336,7 +336,7 @@ function Server(options, requestListener) { if (insecureHTTPParser !== undefined && typeof insecureHTTPParser !== 'boolean') { throw new ERR_INVALID_ARG_TYPE( - 'insecureHTTPParser', 'boolean', insecureHTTPParser); + 'options.insecureHTTPParser', 'boolean', insecureHTTPParser); } this.insecureHTTPParser = insecureHTTPParser; diff --git a/test/parallel/test-http-client-check-http-token.js b/test/parallel/test-http-client-check-http-token.js index d09fbe1b8ee959..ef2445ec66e520 100644 --- a/test/parallel/test-http-client-check-http-token.js +++ b/test/parallel/test-http-client-check-http-token.js @@ -23,7 +23,7 @@ server.listen(0, common.mustCall(() => { }, { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: 'The "method" argument must be of type string.' + + message: 'The "options.method" property must be of type string.' + common.invalidArgTypeHelper(method) }); });