Skip to content

Commit

Permalink
Revert "Normalizes URLs for upstream (#1547)" (#1576)
Browse files Browse the repository at this point in the history
This reverts commit 5a29572.

Signed-off-by: Sandor Szücs <[email protected]>
  • Loading branch information
szuecs authored Oct 30, 2020
1 parent d0a5d81 commit aa497f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 0 additions & 4 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"strings"
"time"

"github.com/dimfeld/httppath"
ot "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"github.com/zalando/skipper/circuit"
Expand Down Expand Up @@ -1463,9 +1462,6 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}()

// Change /foo/../bar to /bar for matching and passing upstream
r.URL.Path = httppath.Clean(r.URL.Path)

if p.flags.patchPath() {
r.URL.Path = rfc.PatchPath(r.URL.Path, r.URL.RawPath)
}
Expand Down
3 changes: 2 additions & 1 deletion routing/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,9 @@ func matchLeaves(leaves leafMatchers, req *http.Request, path, exactPath string)
// returns the associated value, and the wildcard parameters from the path definition,
// if any.
func (m *matcher) match(r *http.Request) (*Route, map[string]string) {
// normalize path before matching
// in case ignoring trailing slashes, match without the trailing slash
path := r.URL.Path
path := httppath.Clean(r.URL.Path)
exact := path
if m.matchingOptions.ignoreTrailingSlash() {
path = trimTrailingSlash(path)
Expand Down

0 comments on commit aa497f6

Please sign in to comment.