summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Needham <tom@tre.tomneedham.com>2013-11-13 00:45:49 +0000
committerTom Needham <tom@tre.tomneedham.com>2013-11-13 00:45:49 +0000
commit17e45e20021084f84d07d0c7590ebc2645b5d889 (patch)
tree8e530a4d0473d258c536a92f7a8322bf1897921b
parentdc30056025f63d32de0846bdf14e971988f83cdb (diff)
downloadnextcloud-server-17e45e20021084f84d07d0c7590ebc2645b5d889.tar.gz
nextcloud-server-17e45e20021084f84d07d0c7590ebc2645b5d889.zip
Pick any none 100 status code before defaulting to 100
-rw-r--r--lib/private/api.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/private/api.php b/lib/private/api.php
index eac4a825e07..8307f209d21 100644
--- a/lib/private/api.php
+++ b/lib/private/api.php
@@ -170,7 +170,7 @@ class OC_API {
$response = reset($thirdparty['failed']);
return $response;
} else {
- $responses = array_merge($shipped['succeeded'], $thirdparty['succeeded']);
+ $responses = $thirdparty['succeeded'];
}
// Merge the successful responses
$meta = array();
@@ -182,8 +182,19 @@ class OC_API {
} else {
$data = array_merge_recursive($data, $response->getData());
}
+ $codes[] = $response->getStatusCode();
+ }
+
+ // Use any non 100 status codes
+ $statusCode = 100;
+ foreach($codes as $code) {
+ if($code != 100) {
+ $statusCode = $code;
+ break;
+ }
}
- $result = new OC_OCS_Result($data, 100);
+
+ $result = new OC_OCS_Result($data, $statusCode);
return $result;
}