change const name
Some checks are pending
ci/woodpecker/push/publish Pipeline is pending

This commit is contained in:
Mylloon 2023-04-26 16:57:37 +02:00
parent fddef30bad
commit 81ebbb97ff
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -23,7 +23,7 @@ use crate::{
template::Infos,
};
const MIME_TYPE: &str = "application/rss+xml";
const MIME_TYPE_RSS: &str = "application/rss+xml";
#[get("/blog")]
pub async fn index(config: web::Data<Config>) -> impl Responder {
@ -179,7 +179,7 @@ fn get_post(post: &mut Option<File>, filename: String) -> Infos {
#[get("/blog/rss")]
pub async fn rss(req: HttpRequest, config: web::Data<Config>) -> impl Responder {
HttpResponse::Ok()
.append_header(("content-type", MIME_TYPE))
.append_header(("content-type", MIME_TYPE_RSS))
.body(build_rss(
config.get_ref().to_owned(),
req.connection_info().to_owned(),
@ -263,7 +263,7 @@ fn build_rss(config: Config, info: ConnectionInfo) -> String {
href: format!("{}/blog/rss", link_to_site),
rel: "self".into(),
hreflang: Some(lang.into()),
mime_type: Some(MIME_TYPE.into()),
MIME_TYPE_RSS: Some(MIME_TYPE_RSS.into()),
title: Some(title.to_owned()),
length: None,
}],