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

url: always show password for URL instances #12420

Closed
wants to merge 1 commit into from
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
5 changes: 1 addition & 4 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ class URL {
throw new errors.TypeError('ERR_INVALID_THIS', 'URL');
}

const ctx = this[context];

if (typeof depth === 'number' && depth < 0)
return opts.stylize('[Object]', 'special');

Expand All @@ -221,8 +219,7 @@ class URL {
obj.origin = this.origin;
obj.protocol = this.protocol;
obj.username = this.username;
obj.password = (opts.showHidden || ctx.password === '') ?
this.password : '--------';
obj.password = this.password;
obj.host = this.host;
obj.hostname = this.hostname;
obj.port = this.port;
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-whatwg-url-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ assert.strictEqual(
origin: 'https://host.name:8080',
protocol: 'https:',
username: 'username',
password: '--------',
password: 'password',
host: 'host.name:8080',
hostname: 'host.name',
port: '8080',
Expand Down