Skip to content

Commit 15b1dbd

Browse files
committedAug 14, 2021
[fix] Do not lose the password in the stringification process
Handle the case where the value of the `username` property is empty and the value of the `password` property is non-empty.
1 parent 993acbe commit 15b1dbd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎index.js

+3
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,9 @@ function toString(stringify) {
509509
result += url.username;
510510
if (url.password) result += ':'+ url.password;
511511
result += '@';
512+
} else if (url.password) {
513+
result += ':'+ url.password;
514+
result += '@';
512515
}
513516

514517
result += url.host + url.pathname;

0 commit comments

Comments
 (0)
Please sign in to comment.