From 2d87a84709cb0ee89b2fbafe65718bd61d9effef Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 14 May 2021 09:05:50 +0100 Subject: [PATCH] Stop calling WriteHeader in Write (#15862) Fixes http: superfluous response.WriteHeader call from code.gitea.io/gitea/modules/context.(*Response).WriteHeader (response.go:67) * Looking again we don't need this writeHeader as all of our downstream implementations will always do it for us Signed-off-by: Andrew Thornton Co-authored-by: Lauris BH --- modules/context/response.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/context/response.go b/modules/context/response.go index 4ffbd230a2..a20fc63536 100644 --- a/modules/context/response.go +++ b/modules/context/response.go @@ -49,7 +49,7 @@ func (r *Response) Write(bs []byte) (int, error) { return size, err } if r.status == 0 { - r.WriteHeader(200) + r.status = http.StatusOK } return size, nil }