From b759691db8bf6faea7ecac89131fe20f3c638ce4 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Mon, 5 Oct 2020 11:57:50 +0200 Subject: [PATCH] Build paths with path.Join --- accounts/pkg/storage/cs3.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/accounts/pkg/storage/cs3.go b/accounts/pkg/storage/cs3.go index edf23ba0cd..f642e31530 100644 --- a/accounts/pkg/storage/cs3.go +++ b/accounts/pkg/storage/cs3.go @@ -4,7 +4,6 @@ import ( "bytes" "context" "encoding/json" - "fmt" "io" "io/ioutil" "net/http" @@ -118,7 +117,7 @@ func (r CS3Repo) DeleteAccount(ctx context.Context, id string) (err error) { resp, err := r.storageProvider.Delete(ctx, &provider.DeleteRequest{ Ref: &provider.Reference{ - Spec: &provider.Reference_Path{Path: fmt.Sprintf("/meta/%s/%s", accountsFolder, id)}, + Spec: &provider.Reference_Path{Path: path.Join("/meta", accountsFolder, id)}, }, }) @@ -192,7 +191,7 @@ func (r CS3Repo) DeleteGroup(ctx context.Context, id string) (err error) { resp, err := r.storageProvider.Delete(ctx, &provider.DeleteRequest{ Ref: &provider.Reference{ - Spec: &provider.Reference_Path{Path: fmt.Sprintf("/meta/%s/%s", groupsFolder, id)}, + Spec: &provider.Reference_Path{Path: path.Join("/meta", groupsFolder, id)}, }, }) @@ -229,7 +228,7 @@ func (r CS3Repo) groupURL(id string) string { func (r CS3Repo) makeRootDirIfNotExist(ctx context.Context, folder string) error { var rootPathRef = &provider.Reference{ - Spec: &provider.Reference_Path{Path: fmt.Sprintf("/meta/%v", folder)}, + Spec: &provider.Reference_Path{Path: path.Join("/meta", folder)}, } resp, err := r.storageProvider.Stat(ctx, &provider.StatRequest{