1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00

Merge pull request #86 from CaptainCodeman/response-size

Response reset size
This commit is contained in:
Vishal Rana 2015-05-27 21:57:41 -07:00
commit 7d518ce19d
2 changed files with 7 additions and 0 deletions

View File

@ -76,6 +76,7 @@ func (r *Response) Size() int64 {
func (r *Response) reset(w http.ResponseWriter) {
r.writer = w
r.size = 0
r.status = http.StatusOK
r.committed = false
}

View File

@ -37,4 +37,10 @@ func TestResponse(t *testing.T) {
if r.Size() != int64(len(s)) {
t.Errorf("size should be %d", len(s))
}
// reser
r.reset(httptest.NewRecorder())
if r.Size() != int64(0) {
t.Error("size should be 0")
}
}