Skip to content

Commit c72fda4

Browse files
committed
sanitizeURL: show * instead of %2A for redacted values
1 parent d7688de commit c72fda4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/api/api.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ func isSensitiveParam(name string) bool {
124124

125125
// sanitizeURL redacts sensitive query parameter values, strips the fragment,
126126
// and masks embedded passwords, returning a safe-for-listing URL string.
127+
// Redaction uses "*"; net/url encodes it as %2A, so restore it on output.
127128
func sanitizeURL(raw string) string {
128129
u, err := url.Parse(raw)
129130
if err != nil {
@@ -156,7 +157,7 @@ func sanitizeURL(raw string) string {
156157
}
157158
}
158159

159-
return u.String()
160+
return strings.ReplaceAll(u.String(), "%2A", "*")
160161
}
161162

162163
var (

0 commit comments

Comments
 (0)