Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
972fffbe
Commit
972fffbe
authored
10 years ago
by
Vincent Petry
Browse files
Options
Downloads
Patches
Plain Diff
Return 503 OCS response with requested format
parent
2e45eb8a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/api.php
+1
-1
1 addition, 1 deletion
lib/private/api.php
ocs/v1.php
+2
-1
2 additions, 1 deletion
ocs/v1.php
with
3 additions
and
2 deletions
lib/private/api.php
+
1
−
1
View file @
972fffbe
...
...
@@ -301,7 +301,7 @@ class OC_API {
* @param OC_OCS_Result $result
* @param string $format the format xml|json
*/
p
rivate
static
function
respond
(
$result
,
$format
=
'xml'
)
{
p
ublic
static
function
respond
(
$result
,
$format
=
'xml'
)
{
// Send 401 headers if unauthorised
if
(
$result
->
getStatusCode
()
===
self
::
RESPOND_UNAUTHORISED
)
{
header
(
'WWW-Authenticate: Basic realm="Authorisation Required"'
);
...
...
This diff is collapsed.
Click to expand it.
ocs/v1.php
+
2
−
1
View file @
972fffbe
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment