Skip to content

Commit

Permalink
Disable gorilla/mux URL cleaning to prevent sending redirect
Browse files Browse the repository at this point in the history
This fixes traefik#167 and traefik#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 gorilla/mux#94 for background.
  • Loading branch information
ydubreuil committed Sep 20, 2016
1 parent 7e8937a commit 82cb21f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 82cb21f

Please sign in to comment.