1
0

Update echo (#82)

This commit is contained in:
konrad
2019-06-22 21:51:58 +00:00
committed by Gitea
parent 4e8c2a7bf6
commit 16825ba7c6
121 changed files with 6124 additions and 917 deletions

View File

@ -67,7 +67,10 @@ func (r *Response) WriteHeader(code int) {
// Write writes the data to the connection as part of an HTTP reply.
func (r *Response) Write(b []byte) (n int, err error) {
if !r.Committed {
r.WriteHeader(http.StatusOK)
if r.Status == 0 {
r.Status = http.StatusOK
}
r.WriteHeader(r.Status)
}
n, err = r.Writer.Write(b)
r.Size += int64(n)