[Pkg-owncloud-commits] [owncloud] 142/273: Return 503 OCS response with requested format
David Prévot
taffit at moszumanska.debian.org
Fri Jul 4 03:13:10 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 972fffbe02d1e0493d498859b76de698ecf5d067
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Mon Jun 30 15:37:38 2014 +0200
Return 503 OCS response with requested format
---
lib/private/api.php | 2 +-
ocs/v1.php | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/private/api.php b/lib/private/api.php
index 7488769..e9c1445 100644
--- a/lib/private/api.php
+++ b/lib/private/api.php
@@ -301,7 +301,7 @@ class OC_API {
* @param OC_OCS_Result $result
* @param string $format the format xml|json
*/
- private static function respond($result, $format='xml') {
+ public static function respond($result, $format='xml') {
// Send 401 headers if unauthorised
if($result->getStatusCode() === self::RESPOND_UNAUTHORISED) {
header('WWW-Authenticate: Basic realm="Authorisation Required"');
diff --git a/ocs/v1.php b/ocs/v1.php
index 624355a..0a86fb0 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -27,7 +27,8 @@ 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);
- OC_Template::printErrorPage('Service unavailable');
+ $response = new OC_OCS_Result(null, OC_Response::STATUS_SERVICE_UNAVAILABLE, 'Service unavailable');
+ OC_API::respond($response, OC_API::requestedFormat());
exit;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list