1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-15 01:34:53 +02:00

Changed signature for response before func

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2017-06-29 10:59:21 -07:00
parent c7531df815
commit ee85b46a05
3 changed files with 9 additions and 15 deletions

View File

@ -12,10 +12,10 @@ func TestResponse(t *testing.T) {
req := httptest.NewRequest(GET, "/", nil)
rec := httptest.NewRecorder()
c := e.NewContext(req, rec)
res := &Response{context: c, Writer: rec}
res := &Response{echo: e, Writer: rec}
// Before
res.Before(func(c Context) {
res.Before(func() {
c.Response().Header().Set(HeaderServer, "echo")
})
res.Write([]byte("test"))