Merge pull request #18084 from owncloud/ocs-anything-other-then-100-means-failure

[OCS] Error handling - fix in status code mapper
This commit is contained in:
Thomas Müller 2015-08-05 23:57:46 +02:00
commit 923a22a11e
2 changed files with 2 additions and 6 deletions

View File

@ -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;
}
/**

View File

@ -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],
];
}