rss content type
Some checks failed
Fly Deploy / Deploy app (push) Failing after 54s

This commit is contained in:
Gabriel Simmer 2023-09-22 11:33:56 +01:00
parent 8761b57f80
commit dcba9beba2
Signed by: arch
SSH key fingerprint: SHA256:m3OEcdtrnBpMX+2BDGh/byv3hrCekCLzDYMdvGEKPPQ

View file

@ -175,7 +175,11 @@ async fn rss() -> Result<impl IntoResponse, StatusCode> {
.items(posts) .items(posts)
.build(); .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 { fn header(page_title: &str) -> Markup {
@ -328,7 +332,6 @@ async fn blog_post(Path(post): Path<String>) -> Result<impl IntoResponse, Status
return Ok(Response::builder() return Ok(Response::builder()
.header("content-type", "text/html") .header("content-type", "text/html")
.header("cache", "hit")
.status(StatusCode::OK) .status(StatusCode::OK)
.body(Full::from(html.into_string())) .body(Full::from(html.into_string()))
.unwrap()); .unwrap());