From 79d9841bce94c0e9abf5e53c845236296a8999de Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 26 Jun 2018 10:32:50 +0200 Subject: Replace hardcoded status headers with calls to http_response_code() Signed-off-by: Morris Jobke --- ocs/v1.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ocs') 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) { -- cgit v1.2.3