Fix raw path handling in strip prefix

This commit is contained in:
Marco Jantke 2017-11-21 14:28:03 +01:00 committed by Traefiker
parent c9129b8ecf
commit 676b79db42
4 changed files with 47 additions and 6 deletions

View file

@ -40,6 +40,9 @@ func (s *StripPrefixRegex) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
r.URL.Path = r.URL.Path[len(prefix.Path):]
if r.URL.RawPath != "" {
r.URL.RawPath = r.URL.RawPath[len(prefix.Path):]
}
r.Header.Add(ForwardedPrefixHeader, prefix.Path)
r.RequestURI = r.URL.RequestURI()
s.Handler.ServeHTTP(w, r)