feat: Add option for a noindex meta tag on the HTML index page

Adds a new config option `index_page_allow_indexing` which defaults to false.

Fixes: !1527
This commit is contained in:
theS1LV3R
2026-03-11 16:47:47 +01:00
committed by Ginger
parent 67d5619ccb
commit 7b6bf4b78e
6 changed files with 28 additions and 1 deletions
+8 -1
View File
@@ -40,6 +40,7 @@ impl IntoResponse for WebError {
struct Error {
error: WebError,
status: StatusCode,
allow_indexing: bool,
}
let status = match &self {
| Self::ValidationError(_)
@@ -50,7 +51,13 @@ impl IntoResponse for WebError {
| _ => StatusCode::INTERNAL_SERVER_ERROR,
};
let template = Error { error: self, status };
let template = Error {
error: self,
status,
// Statically set false to prevent error pages from being indexed and to prevent
// further errors if services.config is having issues.
allow_indexing: false,
};
if let Ok(body) = template.render() {
(status, Html(body)).into_response()