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() .render()
.unwrap(); .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 { } else {
let items = items_result.unwrap(); let items = items_result.unwrap();

View File

@ -28,7 +28,7 @@ async fn render(id: String, sort: String) -> Result<HttpResponse> {
} }
.render() .render()
.unwrap(); .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 { } else {
let s = PostTemplate { let s = PostTemplate {
comments: comments.unwrap(), comments: comments.unwrap(),

View File

@ -46,7 +46,7 @@ pub async fn render(sub_name: String, sort: Option<String>, ends: (Option<String
} }
.render() .render()
.unwrap(); .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 { } else {
let mut sub = sub_result.unwrap(); let mut sub = sub_result.unwrap();
let items = items_result.unwrap(); let items = items_result.unwrap();

View File

@ -26,7 +26,7 @@ async fn render(username: String, sort: String) -> Result<HttpResponse> {
} }
.render() .render()
.unwrap(); .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 { } else {
let s = UserTemplate { let s = UserTemplate {
user: user.unwrap(), user: user.unwrap(),