We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 00f182b commit a07d1caCopy full SHA for a07d1ca
internal/redact/redact.go
@@ -51,7 +51,7 @@ func Error(err error) error {
51
if perr != nil {
52
return err // If the URL can't be parsed, just return the original error.
53
}
54
- uerr.URL = URL(u).String() // Update the URL to the redacted URL.
+ uerr.URL = URL(u) // Update the URL to the redacted URL.
55
return uerr
56
57
@@ -73,7 +73,7 @@ var paramAllowlist = map[string]struct{}{
73
74
75
// URL redacts potentially sensitive query parameter values from the URL's query string.
76
-func URL(u *url.URL) *url.URL {
+func URL(u *url.URL) string {
77
qs := u.Query()
78
for k, v := range qs {
79
for i := range v {
@@ -85,5 +85,5 @@ func URL(u *url.URL) *url.URL {
85
86
r := *u
87
r.RawQuery = qs.Encode()
88
- return &r
+ return r.Redacted()
89
0 commit comments