From 784470de36080dc99abb7ea8182dac26c936a69e Mon Sep 17 00:00:00 2001 From: Willy Kloucek <34452982+wkloucek@users.noreply.github.com> Date: Wed, 1 Sep 2021 16:20:02 +0200 Subject: [PATCH] fix http: superfluous response.WriteHeader call (#2030) --- changelog/unreleased/superfluous-response-write-header.md | 5 +++++ internal/http/services/datagateway/datagateway.go | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/superfluous-response-write-header.md diff --git a/changelog/unreleased/superfluous-response-write-header.md b/changelog/unreleased/superfluous-response-write-header.md new file mode 100644 index 0000000000..6e6b278f63 --- /dev/null +++ b/changelog/unreleased/superfluous-response-write-header.md @@ -0,0 +1,5 @@ +Bugfix: Fix superfluous WriteHeader on file upload + +Removes superfluous Writeheader on file upload and therefore removes the error message "http: superfluous response.WriteHeader call from github.com/cs3org/reva/internal/http/interceptors/log.(*responseLogger).WriteHeader (log.go:154)" + +https://github.com/cs3org/reva/pull/2030 diff --git a/internal/http/services/datagateway/datagateway.go b/internal/http/services/datagateway/datagateway.go index c57c964291..0ba7affd55 100644 --- a/internal/http/services/datagateway/datagateway.go +++ b/internal/http/services/datagateway/datagateway.go @@ -239,7 +239,6 @@ func (s *svc) doGet(w http.ResponseWriter, r *http.Request) { defer httpRes.Body.Close() copyHeader(w.Header(), httpRes.Header) - w.WriteHeader(httpRes.StatusCode) switch httpRes.StatusCode { case http.StatusOK: case http.StatusPartialContent: