Skip to content

Commit

Permalink
fix: clean password by using url object itself (#178)
Browse files Browse the repository at this point in the history
* rebuild the url instead of replacing the password

* Fix issues perventing the tests from passing
  • Loading branch information
DEMON1A committed Apr 13, 2023
1 parent 71d8f72 commit 15dd221
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/clean-url.js
Expand Up @@ -12,7 +12,8 @@ const cleanUrl = (str) => {
try {
const url = new URL(str)
if (url.password) {
str = str.replace(url.password, replace)
url.password = replace
str = url.toString()
}
} catch {
// ignore errors
Expand Down

0 comments on commit 15dd221

Please sign in to comment.