Skip to content

Commit

Permalink
[fix] Do not lose the password in the stringification process
Browse files Browse the repository at this point in the history
Handle the case where the value of the `username` property is empty and
the value of the `password` property is non-empty.
  • Loading branch information
lpinca committed Aug 14, 2021
1 parent 993acbe commit 15b1dbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Expand Up @@ -509,6 +509,9 @@ function toString(stringify) {
result += url.username;
if (url.password) result += ':'+ url.password;
result += '@';
} else if (url.password) {
result += ':'+ url.password;
result += '@';
}

result += url.host + url.pathname;
Expand Down

0 comments on commit 15b1dbd

Please sign in to comment.