diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-05 11:23:29 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-05 11:23:29 +0200 |
commit | 6c46430cdb6edf411142d0a73fb888391ea86fd7 (patch) | |
tree | 02534769c0387a4d5ceccdcd9dee5819b5f15942 | |
parent | 3ecf7fce79798a368ee16cb5dc5404ba16752f56 (diff) | |
download | nextcloud-server-6c46430cdb6edf411142d0a73fb888391ea86fd7.tar.gz nextcloud-server-6c46430cdb6edf411142d0a73fb888391ea86fd7.zip |
Return 200 not null - we should return consistent types
-rw-r--r-- | lib/private/api.php | 3 | ||||
-rw-r--r-- | tests/ocs/response.php | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/api.php b/lib/private/api.php index 6f44401576b..86d7558526b 100644 --- a/lib/private/api.php +++ b/lib/private/api.php @@ -423,6 +423,7 @@ class OC_API { /** * @param integer $sc + * @return int */ public static function mapStatusCodes($sc) { switch ($sc) { @@ -447,7 +448,7 @@ class OC_API { if ($sc > 100 && $sc < 200) { return Http::STATUS_BAD_REQUEST; } - return null; + return Http::STATUS_OK; } /** diff --git a/tests/ocs/response.php b/tests/ocs/response.php index 71397bcf2c9..0d5883fa4cc 100644 --- a/tests/ocs/response.php +++ b/tests/ocs/response.php @@ -35,6 +35,8 @@ class OcsResponseTest extends \Test\TestCase { return [ [Http::STATUS_OK, 100], [Http::STATUS_BAD_REQUEST, 104], + [Http::STATUS_OK, 1000], + [201, 201], ]; } } |