From ebc4459bc19e1a7bfe6a6428b6bd2c4beef97040 Mon Sep 17 00:00:00 2001 From: Ishank Arora Date: Thu, 26 Nov 2020 17:33:43 +0530 Subject: [PATCH] Return false in split method in gateway SP for invalid paths instead of panic --- internal/grpc/services/gateway/storageprovider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/grpc/services/gateway/storageprovider.go b/internal/grpc/services/gateway/storageprovider.go index 399ab087a4f..4b9bcd09df8 100644 --- a/internal/grpc/services/gateway/storageprovider.go +++ b/internal/grpc/services/gateway/storageprovider.go @@ -2016,7 +2016,7 @@ func (s *svc) split(ctx context.Context, p string, i int) bool { // validate that we have always at least two elements if len(parts) < 2 { - panic(fmt.Sprintf("split: len(parts) < 2: path:%s parts:%+v", p, parts)) + return false } // validate the share folder is always the second element, first element is always the hardcoded value of "home"