mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Also rewrite r.URL.Path, as gorilla mux reads this.
This commit is contained in:
@@ -21,6 +21,7 @@ type pathRewrite struct {
|
||||
func (p pathRewrite) Wrap(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
r.RequestURI = p.regexp.ReplaceAllString(r.RequestURI, p.replacement)
|
||||
r.URL.Path = p.regexp.ReplaceAllString(r.RequestURI, p.replacement)
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user