From 7bef292f90aa78b8e7f3f562ea4d9ac5da4232c5 Mon Sep 17 00:00:00 2001 From: "shuwen.wu" Date: Thu, 8 Oct 2026 14:03:42 +0800 Subject: [PATCH] Return 503 Service Unavailable when admin panel is disabled Previously the /admin route returned 200 OK with a plain-text message when ADMIN_TOKEN was not configured, which misled monitoring tools. Now returns 503 Service Unavailable to correctly signal the service is not available. Fixes #7493 --- src/api/admin.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/admin.rs b/src/api/admin.rs index 2a84f611..8f369028 100644 --- a/src/api/admin.rs +++ b/src/api/admin.rs @@ -98,8 +98,8 @@ static CAN_BACKUP: LazyLock = LazyLock::new(|| ACTIVE_DB_TYPE.get().is_som static CAN_BACKUP: LazyLock = LazyLock::new(|| false); #[get("/")] -fn admin_disabled() -> &'static str { - "The admin panel is disabled, please configure the 'ADMIN_TOKEN' variable to enable it" +fn admin_disabled() -> (Status, &'static str) { + (Status::ServiceUnavailable, "The admin panel is disabled, please configure the 'ADMIN_TOKEN' variable to enable it") } const COOKIE_NAME: &str = "VW_ADMIN";