Skip to content

Commit 2483d2a

Browse files
committed
Reset Echo in Response#reset()
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent f448379 commit 2483d2a

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ func (c *Context) Echo() *Echo {
262262

263263
func (c *Context) reset(r *http.Request, w http.ResponseWriter, e *Echo) {
264264
c.request = r
265-
c.response.reset(w)
265+
c.response.reset(w, e)
266266
c.query = nil
267267
c.store = nil
268268
c.echo = e

response.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ func (r *Response) Committed() bool {
7575
return r.committed
7676
}
7777

78-
func (r *Response) reset(w http.ResponseWriter) {
78+
func (r *Response) reset(w http.ResponseWriter, e *Echo) {
7979
r.writer = w
8080
r.size = 0
8181
r.status = http.StatusOK
8282
r.committed = false
83+
r.echo = e
8384
}

response_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ func TestResponse(t *testing.T) {
6262
})
6363

6464
// reset
65-
r.reset(httptest.NewRecorder())
65+
r.reset(httptest.NewRecorder(), New())
6666
}

0 commit comments

Comments
 (0)