Add Status Codes to Error Pages

This commit is contained in:
spikecodes 2020-11-20 20:43:20 -08:00
parent 0f88936909
commit cef3266186
4 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ async fn render(sub_name: String, sort: Option<String>, ends: (Option<String>, O
}
.render()
.unwrap();
Ok(HttpResponse::Ok().content_type("text/html").body(s))
Ok(HttpResponse::Ok().status(actix_web::http::StatusCode::NOT_FOUND).content_type("text/html").body(s))
} else {
let items = items_result.unwrap();

View File

@ -28,7 +28,7 @@ async fn render(id: String, sort: String) -> Result<HttpResponse> {
}
.render()
.unwrap();
Ok(HttpResponse::Ok().content_type("text/html").body(s))
Ok(HttpResponse::Ok().status(actix_web::http::StatusCode::NOT_FOUND).content_type("text/html").body(s))
} else {
let s = PostTemplate {
comments: comments.unwrap(),

View File

@ -46,7 +46,7 @@ pub async fn render(sub_name: String, sort: Option<String>, ends: (Option<String
}
.render()
.unwrap();
Ok(HttpResponse::Ok().content_type("text/html").body(s))
Ok(HttpResponse::Ok().status(actix_web::http::StatusCode::NOT_FOUND).content_type("text/html").body(s))
} else {
let mut sub = sub_result.unwrap();
let items = items_result.unwrap();

View File

@ -26,7 +26,7 @@ async fn render(username: String, sort: String) -> Result<HttpResponse> {
}
.render()
.unwrap();
Ok(HttpResponse::Ok().content_type("text/html").body(s))
Ok(HttpResponse::Ok().status(actix_web::http::StatusCode::NOT_FOUND).content_type("text/html").body(s))
} else {
let s = UserTemplate {
user: user.unwrap(),