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 authored and Ginger committed 2026-03-18 12:42:55 -04:00
1 parent 67d5619ccb
commit 7b6bf4b78e
6 files changed
+28 -1

No files matched your search

+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()