mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 21:42:34 +00:00
fix: truncate .ics extension of events
This commit is contained in:
@@ -52,10 +52,11 @@ pub async fn put_event<A: CheckAuthentication, C: CalendarStore>(
|
|||||||
body: String,
|
body: String,
|
||||||
_auth: AuthInfoExtractor<A>,
|
_auth: AuthInfoExtractor<A>,
|
||||||
) -> Result<HttpResponse, Error> {
|
) -> Result<HttpResponse, Error> {
|
||||||
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
|
// Incredibly bodged method of normalising the uid but works for a prototype
|
||||||
if cid.ends_with(".ics") {
|
if uid.ends_with(".ics") {
|
||||||
cid.truncate(cid.len() - 4);
|
uid.truncate(uid.len() - 4);
|
||||||
}
|
}
|
||||||
dbg!(&body);
|
dbg!(&body);
|
||||||
context
|
context
|
||||||
|
|||||||
Reference in New Issue
Block a user