From 82cb21fca3f6598fa5451d73034b8a90a4b1db77 Mon Sep 17 00:00:00 2001 From: Yoann Dubreuil Date: Tue, 20 Sep 2016 16:43:09 +0200 Subject: [PATCH] Disable gorilla/mux URL cleaning to prevent sending redirect This fixes #167 and #651. By default, gorilla/mux cleans URL paths such that adjacent slashes are collapsed into one single slash. This behavior is pretty common in application stacks and it is fine, but for Traefik, this can lead to incorrect URL paths forwarded to backend servers. See https://github.com/gorilla/mux/issues/94 for background. --- server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/server.go b/server.go index cafc477c8..6920e83a4 100644 --- a/server.go +++ b/server.go @@ -668,6 +668,7 @@ func (server *Server) buildDefaultHTTPRouter() *mux.Router { router := mux.NewRouter() router.NotFoundHandler = http.HandlerFunc(notFoundHandler) router.StrictSlash(true) + router.SkipClean(true) return router }