diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-05 17:49:44 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-05 17:49:44 +0200 |
commit | db1416346c4f6bd16afeaa454b16f6a2f8112ade (patch) | |
tree | 1e00d18a8ebd02a9cd4a8e2d7936fee64f9c476c | |
parent | 7cb0934fa27a512b2e409361fe283d9c15560327 (diff) | |
download | nextcloud-server-db1416346c4f6bd16afeaa454b16f6a2f8112ade.tar.gz nextcloud-server-db1416346c4f6bd16afeaa454b16f6a2f8112ade.zip |
Following the spec:
"`statuscode`: The OCS status code of the response, everything except 100 MUST be handled as failure."
-rw-r--r-- | lib/private/api.php | 6 | ||||
-rw-r--r-- | tests/ocs/response.php | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/lib/private/api.php b/lib/private/api.php index 86d7558526b..6823a19881f 100644 --- a/lib/private/api.php +++ b/lib/private/api.php @@ -444,11 +444,7 @@ class OC_API { return $sc; } - // any error codes > 100 are treated as client errors - if ($sc > 100 && $sc < 200) { - return Http::STATUS_BAD_REQUEST; - } - return Http::STATUS_OK; + return Http::STATUS_BAD_REQUEST; } /** diff --git a/tests/ocs/response.php b/tests/ocs/response.php index 0d5883fa4cc..919915a7c78 100644 --- a/tests/ocs/response.php +++ b/tests/ocs/response.php @@ -35,7 +35,7 @@ class OcsResponseTest extends \Test\TestCase { return [ [Http::STATUS_OK, 100], [Http::STATUS_BAD_REQUEST, 104], - [Http::STATUS_OK, 1000], + [Http::STATUS_BAD_REQUEST, 1000], [201, 201], ]; } |