MCPcopy Create free account
hub / github.com/docker/secrets-engine / sanitizeEndpoint

Function sanitizeEndpoint

x/telemetry/otel.go:132–151  ·  view source on GitHub ↗
(endpoint string)

Source from the content-addressed store, hash-verified

130}
131
132func sanitizeEndpoint(endpoint string) (string, bool) {
133 u, err := url.Parse(endpoint)
134 if err != nil {
135 otel.Handle(fmt.Errorf("invalid otel endpoint '%s': %s", endpoint, err))
136 return "", false
137 }
138
139 var secure bool
140 switch u.Scheme {
141 // TODO: add support for OTEL endpoints through sockets
142 // case "unix":
143 // endpoint = unixSocketEndpoint(u)
144 case "https":
145 secure = true
146 fallthrough
147 case "http":
148 endpoint = path.Join(u.Host, u.Path)
149 }
150 return endpoint, secure
151}

Callers 1

InitializeOTelFunction · 0.85

Calls 2

HandleMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected