Add Status Codes to Error Pages
This commit is contained in:
parent
0f88936909
commit
cef3266186
@ -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();
|
||||||
|
|
||||||
|
@ -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(),
|
||||||
|
@ -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();
|
||||||
|
@ -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(),
|
||||||
|
Loading…
Reference in New Issue
Block a user