MCPcopy
hub / github.com/caddyserver/caddy / cleanPath

Function cleanPath

modules/caddyhttp/caddyhttp.go:302–308  ·  view source on GitHub ↗

cleanPath does path.Clean(p) but preserves any trailing slash.

(p string)

Source from the content-addressed store, hash-verified

300
301// cleanPath does path.Clean(p) but preserves any trailing slash.
302func cleanPath(p string) string {
303 cleaned := path.Clean(p)
304 if cleaned != "/" && strings.HasSuffix(p, "/") {
305 cleaned = cleaned + "/"
306 }
307 return cleaned
308}
309
310// tlsPlaceholderWrapper is a no-op listener wrapper that marks
311// where the TLS listener should be in a chain of listener wrappers.

Callers 2

MatchWithErrorMethod · 0.85
CleanPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected