mirror of
https://github.com/labstack/echo.git
synced 2025-04-17 12:06:44 +02:00
Reset Echo
in Response#reset()
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
f448379651
commit
2483d2a140
@ -262,7 +262,7 @@ func (c *Context) Echo() *Echo {
|
||||
|
||||
func (c *Context) reset(r *http.Request, w http.ResponseWriter, e *Echo) {
|
||||
c.request = r
|
||||
c.response.reset(w)
|
||||
c.response.reset(w, e)
|
||||
c.query = nil
|
||||
c.store = nil
|
||||
c.echo = e
|
||||
|
@ -75,9 +75,10 @@ func (r *Response) Committed() bool {
|
||||
return r.committed
|
||||
}
|
||||
|
||||
func (r *Response) reset(w http.ResponseWriter) {
|
||||
func (r *Response) reset(w http.ResponseWriter, e *Echo) {
|
||||
r.writer = w
|
||||
r.size = 0
|
||||
r.status = http.StatusOK
|
||||
r.committed = false
|
||||
r.echo = e
|
||||
}
|
||||
|
@ -62,5 +62,5 @@ func TestResponse(t *testing.T) {
|
||||
})
|
||||
|
||||
// reset
|
||||
r.reset(httptest.NewRecorder())
|
||||
r.reset(httptest.NewRecorder(), New())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user