Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http: fixup options.method error message #32471

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,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) {
Expand All @@ -193,7 +193,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;

Expand Down
2 changes: 1 addition & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-http-client-check-http-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});
});
Expand Down