From 7614cab806c66b83306be2f65d113ad3768f4f65 Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 5 Jun 2023 14:15:17 +0200 Subject: [PATCH] set content type --- src/rest/misc.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rest/misc.rs b/src/rest/misc.rs index 8291b7a..7190750 100644 --- a/src/rest/misc.rs +++ b/src/rest/misc.rs @@ -1,4 +1,4 @@ -use rocket::{get, routes, Route, State}; +use rocket::{get, http::ContentType, routes, Route, State}; use rocket_dyn_templates::{context, Template}; use sqlx::SqlitePool; @@ -10,8 +10,8 @@ async fn faq(user: User) -> Template { } #[get("/cal")] -async fn cal(db: &State) -> String { - PlannedEvent::get_ics_feed(db).await +async fn cal(db: &State) -> (ContentType, String) { + (ContentType::Calendar, PlannedEvent::get_ics_feed(db).await) } pub fn routes() -> Vec {