From 8d092c37e7379ff13f0f4e3532dff0fea3390e3b Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Mon, 23 May 2016 16:18:24 +0100 Subject: [PATCH] Also rewrite r.URL.Path, as gorilla mux reads this. --- common/middleware/path_rewrite.go | 1 + 1 file changed, 1 insertion(+) diff --git a/common/middleware/path_rewrite.go b/common/middleware/path_rewrite.go index 195a779ab..5d5dd246c 100644 --- a/common/middleware/path_rewrite.go +++ b/common/middleware/path_rewrite.go @@ -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) }) }