Return 200 not null - we should return consistent types
This commit is contained in:
parent
3ecf7fce79
commit
6c46430cdb
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue