Skip to content

Commit

Permalink
Set special header for 503 maintenance mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ChristophWurst committed Jul 8, 2022
1 parent 48ece9f commit 8e90dd1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('Nextcloud-Maintenance-Mode: 1');
header('Retry-After: 120');

// render error page
Expand Down

0 comments on commit 8e90dd1

Please sign in to comment.