mirror of
https://github.com/labstack/echo.git
synced 2025-01-12 01:22:21 +02:00
parent
93963365bf
commit
e16b929900
@ -367,6 +367,7 @@ func detectContentType(name string) (t string) {
|
||||
}
|
||||
|
||||
func (c *context) reset(req engine.Request, res engine.Response) {
|
||||
c.netContext = nil
|
||||
c.request = req
|
||||
c.response = res
|
||||
c.query = nil
|
||||
|
@ -146,7 +146,10 @@ func WrapMiddleware(m func(http.Handler) http.Handler) echo.MiddlewareFunc {
|
||||
req := c.Request().(*Request)
|
||||
res := c.Response().(*Response)
|
||||
m(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
res.ResponseWriter = w
|
||||
res.ResponseWriter = &responseAdapter{
|
||||
ResponseWriter: res.ResponseWriter,
|
||||
writer: c.Response(),
|
||||
}
|
||||
req.Request = r
|
||||
err = next.Handle(c)
|
||||
})).ServeHTTP(res.ResponseWriter, req.Request)
|
||||
|
Loading…
Reference in New Issue
Block a user