karton/src/endpoints/errors.rs
Daniel Szabo be3ac27920 Quick patch:
- Changed 302 responses to 200 where needed
- Fixed a bug where expiring pastas cause MicroBin to crahs
- Fixed a bug where water.css didn't have the correct MIME type
- Fixed a bug where missing doctype declaration caused styling issues in Firefox
2022-06-04 21:50:34 +01:00

16 lines
389 B
Rust

use actix_web::{Error, HttpResponse};
use askama::Template;
use crate::args::{Args, ARGS};
#[derive(Template)]
#[template(path = "error.html")]
pub struct ErrorTemplate<'a> {
pub args: &'a Args,
}
pub async fn not_found() -> Result<HttpResponse, Error> {
Ok(HttpResponse::Ok()
.content_type("text/html")
.body(ErrorTemplate { args: &ARGS }.render().unwrap()))
}