From 32483fdaf67a8240b09d239a91cac497e2009a0f Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 20 Oct 2020 15:52:28 +0200 Subject: [PATCH] change response status to maintain backwards compatibility to ownCloud 10 Signed-off-by: David Christofas --- changelog/unreleased/propfind-backwards-compatibility.md | 7 +++++++ internal/http/services/owncloud/ocdav/propfind.go | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/propfind-backwards-compatibility.md diff --git a/changelog/unreleased/propfind-backwards-compatibility.md b/changelog/unreleased/propfind-backwards-compatibility.md new file mode 100644 index 0000000000..1084e09927 --- /dev/null +++ b/changelog/unreleased/propfind-backwards-compatibility.md @@ -0,0 +1,7 @@ +Bugfix: Fix propfind response code on forbidden files + +When executing a propfind to a resource owned by another user the service would respond with a HTTP 403. +In ownCloud 10 the response was HTTP 207. This change sets the response code to HTTP 207 to stay backwards compatible. + +https://github.com/cs3org/reva/pull/1259 + diff --git a/internal/http/services/owncloud/ocdav/propfind.go b/internal/http/services/owncloud/ocdav/propfind.go index 530031107c..3b18e2db17 100644 --- a/internal/http/services/owncloud/ocdav/propfind.go +++ b/internal/http/services/owncloud/ocdav/propfind.go @@ -94,7 +94,7 @@ func (s *svc) handlePropfind(w http.ResponseWriter, r *http.Request, ns string) w.WriteHeader(http.StatusNotFound) case rpc.Code_CODE_PERMISSION_DENIED: log.Debug().Str("path", fn).Interface("status", res.Status).Msg("permission denied") - w.WriteHeader(http.StatusForbidden) + w.WriteHeader(http.StatusMultiStatus) default: log.Error().Str("path", fn).Interface("status", res.Status).Msg("grpc stat request failed") w.WriteHeader(http.StatusInternalServerError)