fix the response not send issue when set header first

merge_conn
fangdingjun 6 years ago
parent 078ecb7734
commit 5e853f2807

@ -101,7 +101,7 @@ func (s *stream) Write(buf []byte) (int, error) {
if s.closed {
return 0, io.EOF
}
if s.conn.isServer && s.response == nil {
if s.conn.isServer && (s.response == nil || s.response.StatusCode == 0) {
s.WriteHeader(http.StatusOK)
}

Loading…
Cancel
Save