improve status handling for response of ghttp.Server

This commit is contained in:
John
2019-09-14 22:57:57 +08:00
parent 966c93af00
commit 953ea55899

View File

@ -47,7 +47,7 @@ func (r *Response) Write(content ...interface{}) {
if len(content) == 0 {
return
}
if r.Status == 0 {
if r.Status == 0 && r.request.hasServeHandler {
r.Status = http.StatusOK
}
for _, v := range content {