mirror of https://github.com/jlelse/GoBlog
Fix chi routing rawpath
This commit is contained in:
parent
fa3242917b
commit
5a284ab286
3
http.go
3
http.go
|
@ -294,5 +294,8 @@ func (d *dynamicHandler) swapHandler(h http.Handler) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *dynamicHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (d *dynamicHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// Fix to use Path routing instead of RawPath routing in Chi
|
||||||
|
r.URL.RawPath = ""
|
||||||
|
// Serve request
|
||||||
d.realHandler.Load().(http.Handler).ServeHTTP(w, r)
|
d.realHandler.Load().(http.Handler).ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue