Skip to content

Commit 5d3ea70

Browse files
committed
Closes #275
Signed-off-by: Vishal Rana <[email protected]>
1 parent f12d77f commit 5d3ea70

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

response.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ func (r *Response) WriteHeader(code int) {
6060
// Additionally, Write will increment the size of the current response.
6161
// See [http.Response.Write](https://golang.org/pkg/net/http/#Response.Write)
6262
func (r *Response) Write(b []byte) (n int, err error) {
63+
if !r.committed {
64+
r.WriteHeader(http.StatusOK)
65+
}
6366
n, err = r.writer.Write(b)
6467
r.size += int64(n)
6568
return n, err

0 commit comments

Comments
 (0)