From dcba9beba2eea98406846c8c72a21ae81e3f4682 Mon Sep 17 00:00:00 2001 From: Gabriel Simmer Date: Fri, 22 Sep 2023 11:33:56 +0100 Subject: [PATCH] rss content type --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 03112f6..8905b43 100644 --- a/src/main.rs +++ b/src/main.rs @@ -175,7 +175,11 @@ async fn rss() -> Result { .items(posts) .build(); - return Ok(channel.to_string()); + return Ok(Response::builder() + .header("content-type", "application/rss+xml") + .status(StatusCode::OK) + .body(Full::from(channel.to_string())) + .unwrap()); } fn header(page_title: &str) -> Markup { @@ -328,7 +332,6 @@ async fn blog_post(Path(post): Path) -> Result