summaryrefslogtreecommitdiffstats
path: root/ocs/v1.php
diff options
context:
space:
mode:
Diffstat (limited to 'ocs/v1.php')
-rw-r--r--ocs/v1.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/ocs/v1.php b/ocs/v1.php
index d69904fc495..0a86fb06411 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -23,6 +23,15 @@
require_once '../lib/base.php';
+if (\OCP\Util::needUpgrade()) {
+ // since the behavior of apps or remotes are unpredictable during
+ // an upgrade, return a 503 directly
+ OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
+ $response = new OC_OCS_Result(null, OC_Response::STATUS_SERVICE_UNAVAILABLE, 'Service unavailable');
+ OC_API::respond($response, OC_API::requestedFormat());
+ exit;
+}
+
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;