From fb72684c2403c7bd73d25919b7293d226656b070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Fri, 19 Jul 2024 10:41:34 +0200 Subject: [PATCH] fix: explicitly set the HTTP status for the access log --- services/collaboration/pkg/connector/httpadapter.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/collaboration/pkg/connector/httpadapter.go b/services/collaboration/pkg/connector/httpadapter.go index 6dff8133b..e0dfe1825 100644 --- a/services/collaboration/pkg/connector/httpadapter.go +++ b/services/collaboration/pkg/connector/httpadapter.go @@ -223,6 +223,9 @@ func (h *HttpAdapter) GetFile(w http.ResponseWriter, r *http.Request) { http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) } } + // status might have been already sent if the file is big enough, but for + // small files, the content might still be buffered. + w.WriteHeader(http.StatusOK) } // PutFile will upload the file @@ -348,8 +351,7 @@ func (h *HttpAdapter) DeleteFile(w http.ResponseWriter, r *http.Request) { } return } - // If no error, a HTTP 200 should be sent automatically. - // X-WOPI-Lock header isn't needed on HTTP 200 + w.WriteHeader(http.StatusOK) } func (h *HttpAdapter) RenameFile(w http.ResponseWriter, r *http.Request) {