MCPcopy Index your code
hub / github.com/google/go-github / sanitizeURL

Function sanitizeURL

github/github.go:1648–1664  ·  view source on GitHub ↗

sanitizeURL redacts sensitive parameters from the URL which may be exposed to the user.

(uri *url.URL)

Source from the content-addressed store, hash-verified

1646// sanitizeURL redacts sensitive parameters from the URL which may be
1647// exposed to the user.
1648func sanitizeURL(uri *url.URL) *url.URL {
1649 if uri == nil {
1650 return nil
1651 }
1652 params := uri.Query()
1653 var redacted bool
1654 for _, p := range sensitiveParams {
1655 if len(params.Get(p)) > 0 {
1656 params.Set(p, "REDACTED")
1657 redacted = true
1658 }
1659 }
1660 if redacted {
1661 uri.RawQuery = params.Encode()
1662 }
1663 return uri
1664}
1665
1666/*
1667An Error reports more details on an individual error in an ErrorResponse.

Callers 6

bareDoMethod · 0.85
ErrorMethod · 0.85
ErrorMethod · 0.85
ErrorMethod · 0.85
ErrorMethod · 0.85
TestSanitizeURLFunction · 0.85

Calls 1

GetMethod · 0.45

Tested by 1

TestSanitizeURLFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…