Skip to content

Commit

Permalink
fix: set status code to 404 for the not found page (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
paolobarbolini authored Jan 9, 2025
1 parent ab2a38e commit 7fe6aaf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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> =
Expand Down

0 comments on commit 7fe6aaf

Please sign in to comment.