From 0ed987a8dd578b9597e12bf448abb4e452afa7c1 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 8 Jul 2022 17:45:41 +0200 Subject: [PATCH] Set special header for 503 maintenance mode This removes ambiguity with a 503 returned by app code, web server or similar. Front-end and clients can then handle this state accordingly. Signed-off-by: Christoph Wurst --- lib/base.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/base.php b/lib/base.php index 26ad684a81a47..ef83f6525ad91 100644 --- a/lib/base.php +++ b/lib/base.php @@ -295,6 +295,7 @@ public static function checkMaintenanceMode(\OC\SystemConfig $systemConfig) { if (((bool) $systemConfig->getValue('maintenance', false)) && OC::$SUBURI != '/core/ajax/update.php') { // send http status 503 http_response_code(503); + header('X-Nextcloud-Maintenance-Mode: 1'); header('Retry-After: 120'); // render error page