summaryrefslogtreecommitdiffstats
path: root/ocs
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-06-26 10:32:50 +0200
committerMorris Jobke <hey@morrisjobke.de>2018-06-26 16:14:15 +0200
commit79d9841bce94c0e9abf5e53c845236296a8999de (patch)
treeb676ba133dbf68ad0d64ba21bf192bdb4308294a /ocs
parentd9d557a5ef31d63a8807feac1c530c36a077607f (diff)
downloadnextcloud-server-79d9841bce94c0e9abf5e53c845236296a8999de.tar.gz
nextcloud-server-79d9841bce94c0e9abf5e53c845236296a8999de.zip
Replace hardcoded status headers with calls to http_response_code()
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'ocs')
-rw-r--r--ocs/v1.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/ocs/v1.php b/ocs/v1.php
index fb996d0564d..1f5d3e6619e 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -36,7 +36,7 @@ if (\OCP\Util::needUpgrade()
|| \OC::$server->getSystemConfig()->getValue('maintenance', false)) {
// since the behavior of apps or remotes are unpredictable during
// an upgrade, return a 503 directly
- OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
+ http_response_code(503);
$response = new \OC\OCS\Result(null, OC_Response::STATUS_SERVICE_UNAVAILABLE, 'Service unavailable');
OC_API::respond($response, OC_API::requestedFormat());
exit;
@@ -65,7 +65,7 @@ try {
// Fall through the not found
} catch (MethodNotAllowedException $e) {
OC_API::setContentType();
- OC_Response::setStatus(405);
+ http_response_code(405);
exit();
} catch (Exception $ex) {
OC_API::respond($ex->getResult(), OC_API::requestedFormat());
@@ -89,7 +89,7 @@ try {
OC_API::respond(new \OC\OCS\Result(null, \OCP\API::RESPOND_NOT_FOUND, $txt), $format);
} catch (MethodNotAllowedException $e) {
OC_API::setContentType();
- OC_Response::setStatus(405);
+ http_response_code(405);
} catch (\OC\OCS\Exception $ex) {
OC_API::respond($ex->getResult(), OC_API::requestedFormat());
} catch (\OC\User\LoginException $e) {