From fc5e06587822706e9f8fca493f12bb3df20e5fef Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Wed, 11 Oct 2023 09:04:24 -0700 Subject: [PATCH] Only redact the URL password if it was provided --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index b26ed79..c149702 100644 --- a/main.go +++ b/main.go @@ -1274,7 +1274,9 @@ func redactURL(urlstr string) string { return err.Error() } if u.User != nil { - u.User = url.UserPassword(u.User.Username(), redactedString) + if _, found := u.User.Password(); found { + u.User = url.UserPassword(u.User.Username(), redactedString) + } } return u.String() }