From db1416346c4f6bd16afeaa454b16f6a2f8112ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 5 Aug 2015 17:49:44 +0200 Subject: [PATCH] Following the spec: "`statuscode`: The OCS status code of the response, everything except 100 MUST be handled as failure." --- lib/private/api.php | 6 +----- 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 86d7558526..6823a19881 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 0d5883fa4c..919915a7c7 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], ]; }