MCPcopy Create free account
hub / github.com/coder/coder / redactURL

Function redactURL

coderd/x/chatd/chatdebug/transport.go:138–155  ·  view source on GitHub ↗
(u *url.URL)

Source from the content-addressed store, hash-verified

136}
137
138func redactURL(u *url.URL) string {
139 if u == nil {
140 return ""
141 }
142 clone := *u
143 clone.User = nil
144 q := clone.Query()
145 for key, values := range q {
146 if isSensitiveName(key) || isSensitiveJSONKey(key) {
147 for i := range values {
148 values[i] = RedactedValue
149 }
150 q[key] = values
151 }
152 }
153 clone.RawQuery = q.Encode()
154 return clone.String()
155}
156
157func captureRequestBody(req *http.Request) ([]byte, error) {
158 if req == nil || req.Body == nil {

Callers 2

RoundTripMethod · 0.85
sanitizeErrorStringFunction · 0.85

Calls 4

isSensitiveNameFunction · 0.85
isSensitiveJSONKeyFunction · 0.85
EncodeMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected