From c1513b5f3873c5fe83e4928b8fd0d01f1f7973a2 Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Thu, 7 Nov 2024 10:44:04 +0100 Subject: [PATCH] [bum reva] Fix 0-byte file uploads --- changelog/unreleased/fix-0-byte-upload.md | 6 ++++++ go.mod | 2 +- go.sum | 6 ++---- .../reva/v2/internal/http/services/owncloud/ocdav/tus.go | 1 + vendor/modules.txt | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) 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 00000000000..9c58dcf780f --- /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/owncloud/ocis/pull/10500 +https://github.com/owncloud/ocis/issues/10469 diff --git a/go.mod b/go.mod index 8b66969cf85..2da9182a6f2 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible github.com/coreos/go-oidc/v3 v3.11.0 github.com/cs3org/go-cs3apis v0.0.0-20241105092511-3ad35d174fc1 - github.com/cs3org/reva/v2 v2.26.3 + github.com/cs3org/reva/v2 v2.26.4-0.20241107093724-5b9c7e6d2a87 github.com/davidbyttow/govips/v2 v2.15.0 github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e diff --git a/go.sum b/go.sum index 2c09576d09e..bfc2aaac65a 100644 --- a/go.sum +++ b/go.sum @@ -255,10 +255,8 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c= github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME= github.com/cs3org/go-cs3apis v0.0.0-20241105092511-3ad35d174fc1 h1:RU6LT6mkD16xZs011+8foU7T3LrPvTTSWeTQ9OgfhkA= github.com/cs3org/go-cs3apis v0.0.0-20241105092511-3ad35d174fc1/go.mod h1:DedpcqXl193qF/08Y04IO0PpxyyMu8+GrkD6kWK2MEQ= -github.com/cs3org/reva/v2 v2.26.3-0.20241105095836-b7d7c42e082a h1:G6xC0mccLdY4ppL7RG21hPkMR2c7hnPIcmERvevFP5E= -github.com/cs3org/reva/v2 v2.26.3-0.20241105095836-b7d7c42e082a/go.mod h1:KP0Zomt3dNIr/kU2M1mXzTIVFOtxBVS4qmBDMRCfrOQ= -github.com/cs3org/reva/v2 v2.26.3 h1:zF3ZMl/ZidrdI6ZZ0zEDVqTLr+DvegpgS7E5kdTlGF8= -github.com/cs3org/reva/v2 v2.26.3/go.mod h1:KP0Zomt3dNIr/kU2M1mXzTIVFOtxBVS4qmBDMRCfrOQ= +github.com/cs3org/reva/v2 v2.26.4-0.20241107093724-5b9c7e6d2a87 h1:Jay7t9zXiqisQshRjw01KuIt+PXlplRqgM3ypOCwOSg= +github.com/cs3org/reva/v2 v2.26.4-0.20241107093724-5b9c7e6d2a87/go.mod h1:KP0Zomt3dNIr/kU2M1mXzTIVFOtxBVS4qmBDMRCfrOQ= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= diff --git a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/tus.go b/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/tus.go index 0851a7ecb54..c637d7bb28a 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/http/services/owncloud/ocdav/tus.go +++ b/vendor/github.com/cs3org/reva/v2/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: diff --git a/vendor/modules.txt b/vendor/modules.txt index d92b767af6b..60eb4b2f85b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -367,7 +367,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1 -# github.com/cs3org/reva/v2 v2.26.3 +# github.com/cs3org/reva/v2 v2.26.4-0.20241107093724-5b9c7e6d2a87 ## explicit; go 1.22.0 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime