From c5c74e95370343d3d4d1672256a4fb5163334c0f Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 7 Sep 2023 15:52:37 +0200 Subject: [PATCH] chore(caldav): improve trimming .ics file ending --- pkg/routes/caldav/listStorageProvider.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/routes/caldav/listStorageProvider.go b/pkg/routes/caldav/listStorageProvider.go index bcfbf009469..b90f9387810 100644 --- a/pkg/routes/caldav/listStorageProvider.go +++ b/pkg/routes/caldav/listStorageProvider.go @@ -133,9 +133,7 @@ func (vcls *VikunjaCaldavProjectStorage) GetResourcesByList(rpaths []string) ([] var uids []string for _, path := range rpaths { parts := strings.Split(path, "/") - uid := []rune(parts[4]) // The 4th part is the id with ".ics" suffix - endlen := len(uid) - len(".ics") // ".ics" are 4 bytes - uids = append(uids, string(uid[:endlen])) + uids = append(uids, strings.TrimSuffix(parts[4], ".ics")) } s := db.NewSession()