Return 404 for 404 page
Some checks failed
CI / Check typos (push) Successful in 8s
CI / Check links (push) Failing after 13s
CI / Clippy (push) Successful in 54s
CI / Build and test (push) Successful in 1m20s
CI / Build container (push) Has been skipped
CI / Deploy on waypoint (push) Has been skipped
Some checks failed
CI / Check typos (push) Successful in 8s
CI / Check links (push) Failing after 13s
CI / Clippy (push) Successful in 54s
CI / Build and test (push) Successful in 1m20s
CI / Build container (push) Has been skipped
CI / Deploy on waypoint (push) Has been skipped
This commit is contained in:
@@ -87,6 +87,8 @@ pub struct Page {
|
||||
&'a RequestContext,
|
||||
) -> Pin<Box<dyn Future<Output = Markup> + 'a + Send + Sync>>,
|
||||
>,
|
||||
|
||||
pub response_code: StatusCode,
|
||||
}
|
||||
|
||||
impl Default for Page {
|
||||
@@ -96,6 +98,7 @@ impl Default for Page {
|
||||
html_ttl: Some(TimeDelta::days(1)),
|
||||
generate_html: Box::new(|_, _| Box::pin(async { html!() })),
|
||||
immutable: true,
|
||||
response_code: StatusCode::OK,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,7 +118,7 @@ impl Servable for Page {
|
||||
let html = self.generate_html(ctx).await;
|
||||
|
||||
return Rendered {
|
||||
code: StatusCode::OK,
|
||||
code: self.response_code,
|
||||
body: RenderedBody::Markup(html),
|
||||
ttl: self.html_ttl,
|
||||
immutable: self.immutable,
|
||||
|
||||
Reference in New Issue
Block a user