Fix RawPath handling in addPrefix
This commit is contained in:
parent
799136a714
commit
bddad57a7b
2 changed files with 51 additions and 13 deletions
|
@ -12,6 +12,9 @@ type AddPrefix struct {
|
|||
|
||||
func (s *AddPrefix) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
r.URL.Path = s.Prefix + r.URL.Path
|
||||
if r.URL.RawPath != "" {
|
||||
r.URL.RawPath = s.Prefix + r.URL.RawPath
|
||||
}
|
||||
r.RequestURI = r.URL.RequestURI()
|
||||
s.Handler.ServeHTTP(w, r)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue