From 9e6d2503a6eef1103a0547fdca7b068a98966e0e Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Thu, 7 Nov 2024 09:53:39 +0100 Subject: [PATCH] Fix 0-byte file uploads --- changelog/unreleased/fix-0-byte-upload.md | 6 ++++++ internal/http/services/owncloud/ocdav/tus.go | 1 + 2 files changed, 7 insertions(+) create mode 100644 changelog/unreleased/fix-0-byte-upload.md diff --git a/changelog/unreleased/fix-0-byte-upload.md b/changelog/unreleased/fix-0-byte-upload.md new file mode 100644 index 0000000000..69d92a9357 --- /dev/null +++ b/changelog/unreleased/fix-0-byte-upload.md @@ -0,0 +1,6 @@ +Bugfix: Fix 0-byte file uploads + +We fixed an issue where 0-byte files upload did not return the Location header. + +https://github.com/cs3org/reva/pull/4917 +https://github.com/owncloud/ocis/issues/10469 diff --git a/internal/http/services/owncloud/ocdav/tus.go b/internal/http/services/owncloud/ocdav/tus.go index 0851a7ecb5..c637d7bb28 100644 --- a/internal/http/services/owncloud/ocdav/tus.go +++ b/internal/http/services/owncloud/ocdav/tus.go @@ -197,6 +197,7 @@ func (s *svc) handleTusPost(ctx context.Context, w http.ResponseWriter, r *http. } switch tfRes.Status.Code { case rpc.Code_CODE_OK: + w.Header().Set(net.HeaderLocation, "") w.WriteHeader(http.StatusCreated) return case rpc.Code_CODE_ALREADY_EXISTS: