fix: set status code to 404 for the not found page (#244)

This commit is contained in:
Paolo Barbolini 2025-01-09 11:10:17 +01:00 committed by GitHub
parent ab2a38efb2
commit 7fe6aaf8c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,7 +4,7 @@ use actix_web::{
get,
http::{
header::{ContentType, ETag, EntityTag},
Uri,
StatusCode, Uri,
},
web::{Html, Redirect, ServiceConfig, ThinData},
Either, HttpResponse, Resource, Responder,
@ -300,7 +300,10 @@ pub(crate) fn static_files(cfg: &mut ServiceConfig) {
}
pub(crate) async fn not_found() -> impl Responder {
Html::new(views::html::error::render_404().0)
(
Html::new(views::html::error::render_404().0),
StatusCode::NOT_FOUND,
)
}
static SELF_BASE_URL: LazyLock<String> =