From 953ea558995e857433b96463a4b20b74c9568794 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 14 Sep 2019 22:57:57 +0800 Subject: [PATCH] improve status handling for response of ghttp.Server --- net/ghttp/ghttp_response.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ghttp/ghttp_response.go b/net/ghttp/ghttp_response.go index c37f823bf..4518a3e25 100644 --- a/net/ghttp/ghttp_response.go +++ b/net/ghttp/ghttp_response.go @@ -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 {