Return 200 not null - we should return consistent types

This commit is contained in:
Thomas Müller 2015-08-05 11:23:29 +02:00
parent 3ecf7fce79
commit 6c46430cdb
2 changed files with 4 additions and 1 deletions

View File

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

View File

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