Fix replace path rule
* Fix replace path rule * test: add RequestURI tests.
This commit is contained in:
parent
36ee69609e
commit
a09a8b1235
2 changed files with 14 additions and 16 deletions
|
@ -16,5 +16,6 @@ const ReplacedPathHeader = "X-Replaced-Path"
|
|||
func (s *ReplacePath) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
r.Header.Add(ReplacedPathHeader, r.URL.Path)
|
||||
r.URL.Path = s.Path
|
||||
r.RequestURI = r.URL.RequestURI()
|
||||
s.Handler.ServeHTTP(w, r)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue