From cbaf8e87858bede2fb7ea275b52f23aa8e9cd0b1 Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 14 May 2021 15:38:35 +0100 Subject: [PATCH] Stop calling WriteHeader in Write (#15862) (#15873) Backport #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 --- 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 4ffbd230a..a20fc6353 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 }