Skip to content

Commit dcdd8e3

Browse files
committed
fix: fix more status codes and error messages
1 parent 8e51f9a commit dcdd8e3

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

changelog/unreleased/fix-statuscode-move-denied.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ Bugfix: Fixed wrong status code when moving a file to a denied path
22

33
We fixed a bug when the status code 502 was returned when moving a file to a denied path. Status code 403 (forbidden) is now returned to be compatible with oc10.
44

5+
https://github.com/cs3org/reva/pull/4443
56
https://github.com/cs3org/reva/pull/4439

internal/grpc/services/gateway/storageprovider.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ func (s *svc) Move(ctx context.Context, req *provider.MoveRequest) (*provider.Mo
709709

710710
if sourceProviderInfo.Address != destProviderInfo.Address {
711711
return &provider.MoveResponse{
712-
Status: status.NewUnimplemented(ctx, nil, "gateway does not support cross storage move, use copy and delete"),
712+
Status: status.NewPermissionDenied(ctx, nil, "cross storage moves are not permitted, use copy and delete"),
713713
}, nil
714714
}
715715

internal/grpc/services/sharesstorageprovider/sharesstorageprovider.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ func (s *service) Move(ctx context.Context, req *provider.MoveRequest) (*provide
666666

667667
if dstReceivedShare.Share.Id.OpaqueId != srcReceivedShare.Share.Id.OpaqueId {
668668
return &provider.MoveResponse{
669-
Status: status.NewPermissionDenied(ctx, nil, "sharesstorageprovider: can not move between shares"),
669+
Status: status.NewPermissionDenied(ctx, nil, "cross storage moves are not permitted, use copy and delete"),
670670
}, nil
671671
}
672672

internal/http/services/owncloud/ocdav/move.go

-2
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,6 @@ func (s *svc) handleMove(ctx context.Context, w http.ResponseWriter, r *http.Req
283283
status = http.StatusPreconditionFailed
284284
case rpc.Code_CODE_PERMISSION_DENIED:
285285
status = http.StatusForbidden
286-
// create oc10 compatible error message
287-
m = "Destination directory is not writable"
288286
case rpc.Code_CODE_UNIMPLEMENTED:
289287
// We translate this into a Bad Gateway error as per https://www.rfc-editor.org/rfc/rfc4918#section-9.9.4
290288
// > 502 (Bad Gateway) - This may occur when the destination is on another

0 commit comments

Comments
 (0)