Skip to content
Snippets Groups Projects
Commit b619ff60 authored by Vincent Petry's avatar Vincent Petry
Browse files

Return 503 when a config/data dir error exists

parent 3c46dcd7
Branches
No related tags found
No related merge requests found
...@@ -536,6 +536,7 @@ class OC { ...@@ -536,6 +536,7 @@ class OC {
echo $error['hint'] . "\n\n"; echo $error['hint'] . "\n\n";
} }
} else { } else {
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printGuestPage('', 'error', array('errors' => $errors)); OC_Template::printGuestPage('', 'error', array('errors' => $errors));
} }
exit; exit;
......
...@@ -12,6 +12,7 @@ class OC_Response { ...@@ -12,6 +12,7 @@ class OC_Response {
const STATUS_TEMPORARY_REDIRECT = 307; const STATUS_TEMPORARY_REDIRECT = 307;
const STATUS_NOT_FOUND = 404; const STATUS_NOT_FOUND = 404;
const STATUS_INTERNAL_SERVER_ERROR = 500; const STATUS_INTERNAL_SERVER_ERROR = 500;
const STATUS_SERVICE_UNAVAILABLE = 503;
/** /**
* @brief Enable response caching by sending correct HTTP headers * @brief Enable response caching by sending correct HTTP headers
...@@ -74,6 +75,9 @@ class OC_Response { ...@@ -74,6 +75,9 @@ class OC_Response {
case self::STATUS_INTERNAL_SERVER_ERROR; case self::STATUS_INTERNAL_SERVER_ERROR;
$status = $status . ' Internal Server Error'; $status = $status . ' Internal Server Error';
break; break;
case self::STATUS_SERVICE_UNAVAILABLE;
$status = $status . ' Service Unavailable';
break;
} }
header($protocol.' '.$status); header($protocol.' '.$status);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment