소스 검색

Return 503 OCS response with requested format

tags/v7.0.0RC1
Vincent Petry 10 년 전
부모
커밋
972fffbe02
2개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 1
    1
      lib/private/api.php
  2. 2
    1
      ocs/v1.php

+ 1
- 1
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"');

+ 2
- 1
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;
}


Loading…
취소
저장