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 <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2022-07-08 17:45:41 +02:00
parent fe2f8b5d18
commit 0ed987a8dd
No known key found for this signature in database
GPG key ID: CC42AC2A7F0E56D8

View file

@ -295,6 +295,7 @@ class OC {
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