diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-05 23:57:46 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-08-05 23:57:46 +0200 |
commit | 923a22a11eb397090d74dadf17d0f029f826dfbc (patch) | |
tree | cb08ed90b80d91128e5e276c96f438ef29d13d8e | |
parent | 7f44b0fd18771842bba8957dae4a50c5483a7280 (diff) | |
parent | db1416346c4f6bd16afeaa454b16f6a2f8112ade (diff) | |
download | nextcloud-server-923a22a11eb397090d74dadf17d0f029f826dfbc.tar.gz nextcloud-server-923a22a11eb397090d74dadf17d0f029f826dfbc.zip |
Merge pull request #18084 from owncloud/ocs-anything-other-then-100-means-failure
[OCS] Error handling - fix in status code mapper
-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], ]; } |