]> source.dussan.org Git - nextcloud-server.git/commitdiff
Pick any none 100 status code before defaulting to 100
authorTom Needham <tom@tre.tomneedham.com>
Wed, 13 Nov 2013 00:45:49 +0000 (00:45 +0000)
committerTom Needham <tom@tre.tomneedham.com>
Wed, 13 Nov 2013 00:45:49 +0000 (00:45 +0000)
lib/private/api.php

index eac4a825e074067e86a0a2f3118c472882200143..8307f209d21e22e7930789252a8e5f34ba3969a8 100644 (file)
@@ -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;
        }