Closed
Description
ServeMux.Handler should return patterns as passed to Handle.
However, if returning a trailing-slash redirection handler (but not if returning a request sanitizing redirection handler), non-...
wildcards are replaced with the corresponding segment from the path.
The following code
mux := http.NewServeMux()
mux.Handle("/{x}/", http.NotFoundHandler())
r, _ := http.NewRequest("POST", "/foo", nil)
_, p := mux.Handler(r)
fmt.Println(p)
prints /foo/
instead of /{x}/
.