Skip to content

Commit

Permalink
Update pkg/middlewares/stripprefixregex/strip_prefix_regex.go
Browse files Browse the repository at this point in the history
Co-Authored-By: mpl <mathieu.lonjaret@gmail.com>
  • Loading branch information
ldez and mpl committed Sep 3, 2019
1 parent a4f6963 commit c052c68
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/middlewares/stripprefixregex/strip_prefix_regex.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func (s *stripPrefixRegex) ServeHTTP(rw http.ResponseWriter, req *http.Request)
parts := exp.FindStringSubmatch(req.URL.Path)
if len(parts) > 0 && len(parts[0]) > 0 {
prefix := parts[0]
if !strings.HasPrefix(req.URL.Path, prefix) {
continue
}

req.Header.Add(stripprefix.ForwardedPrefixHeader, prefix)

Expand Down

0 comments on commit c052c68

Please sign in to comment.