mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
http: fixup options.method error message
Use `options.method` instead of just `method` Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32471 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
parent
8e00f0d2a2
commit
567b352062
|
|
@ -170,7 +170,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) {
|
||||
|
|
@ -191,7 +191,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -339,7 +339,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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user