Skip to content

Commit

Permalink
change response status to maintain backwards compatibility to ownClou…
Browse files Browse the repository at this point in the history
…d 10 (#1259)

Signed-off-by: David Christofas <dchristofas@owncloud.com>
  • Loading branch information
C0rby authored Oct 21, 2020
1 parent 05ab93e commit dc400f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions changelog/unreleased/propfind-backwards-compatibility.md
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion internal/http/services/owncloud/ocdav/propfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dc400f8

Please sign in to comment.