1
0
mirror of https://github.com/labstack/echo.git synced 2025-03-11 14:49:56 +02:00
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2016-06-03 07:37:20 -07:00
parent f12d77f9cf
commit 5d3ea7014b

View File

@ -60,6 +60,9 @@ func (r *Response) WriteHeader(code int) {
// Additionally, Write will increment the size of the current response.
// See [http.Response.Write](https://golang.org/pkg/net/http/#Response.Write)
func (r *Response) Write(b []byte) (n int, err error) {
if !r.committed {
r.WriteHeader(http.StatusOK)
}
n, err = r.writer.Write(b)
r.size += int64(n)
return n, err