From 29c49d28bd642bc15699619fd642a43fa373d764 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Mon, 23 Nov 2020 17:21:06 +0530 Subject: [PATCH] Fix capabilities response for multiple client versions --- changelog/unreleased/ocs-capabilities.md | 3 +++ .../ocs/handlers/cloud/capabilities/capabilities.go | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 changelog/unreleased/ocs-capabilities.md diff --git a/changelog/unreleased/ocs-capabilities.md b/changelog/unreleased/ocs-capabilities.md new file mode 100644 index 00000000000..514168338c5 --- /dev/null +++ b/changelog/unreleased/ocs-capabilities.md @@ -0,0 +1,3 @@ +Bugfix: Fix capabilities response for multiple client versions + +https://github.com/cs3org/reva/pull/1331 diff --git a/internal/http/services/owncloud/ocs/handlers/cloud/capabilities/capabilities.go b/internal/http/services/owncloud/ocs/handlers/cloud/capabilities/capabilities.go index 091d748cd75..bf2c8b2d584 100644 --- a/internal/http/services/owncloud/ocs/handlers/cloud/capabilities/capabilities.go +++ b/internal/http/services/owncloud/ocs/handlers/cloud/capabilities/capabilities.go @@ -93,9 +93,6 @@ func (h *Handler) Init(c *config.Config) { h.c.Capabilities.Files = &data.CapabilitiesFiles{} } - // h.c.Capabilities.Files.PrivateLinks is boolean - // h.c.Capabilities.Files.BigFileChunking is boolean // TODO is this old or new chunking? jfd: I guess old - if h.c.Capabilities.Files.BlacklistedFiles == nil { h.c.Capabilities.Files.BlacklistedFiles = []string{} } @@ -104,6 +101,10 @@ func (h *Handler) Init(c *config.Config) { if h.c.Capabilities.Files.TusSupport == nil && !c.DisableTus { // these are global capabilities + // Need to disable other chunking methods + h.c.Capabilities.Files.BigFileChunking = false + h.c.Capabilities.Dav.Chunking = "" + // TODO: infer from various TUS handlers from all known storages h.c.Capabilities.Files.TusSupport = &data.CapabilitiesFilesTusSupport{ Version: "1.0.0", @@ -112,6 +113,9 @@ func (h *Handler) Init(c *config.Config) { MaxChunkSize: 0, HTTPMethodOverride: "", } + } else { + // Enable chunking support + h.c.Capabilities.Files.BigFileChunking = true } // dav