From 3ea88f2f3c6855fa3427a7d68983228553cbdd85 Mon Sep 17 00:00:00 2001 From: Lennart <18233294+lennart-k@users.noreply.github.com> Date: Thu, 7 Sep 2023 19:03:59 +0200 Subject: [PATCH] fix: truncate .ics extension of events --- crates/dav/src/routes/event.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/dav/src/routes/event.rs b/crates/dav/src/routes/event.rs index 3075041..e16a23a 100644 --- a/crates/dav/src/routes/event.rs +++ b/crates/dav/src/routes/event.rs @@ -52,10 +52,11 @@ pub async fn put_event( body: String, _auth: AuthInfoExtractor, ) -> Result { - let (_principal, mut cid, uid) = path.into_inner(); + // TODO: verify whether user is authorized + let (_principal, cid, mut uid) = path.into_inner(); // Incredibly bodged method of normalising the uid but works for a prototype - if cid.ends_with(".ics") { - cid.truncate(cid.len() - 4); + if uid.ends_with(".ics") { + uid.truncate(uid.len() - 4); } dbg!(&body); context