Skip to content

Commit 59c5154

Browse files
author
Phil Sturgeon
committed
Merge pull request #189 from caioiglesias/master
http code 204 was coming out as 500
2 parents 8dca4b3 + 29975a2 commit 59c5154

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

application/libraries/REST_Controller.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,12 @@ public function response($data = array(), $http_code = null)
368368
$output = NULL;
369369
}
370370

371+
// If data is empty but http code provided, keep the output empty
372+
else if (empty($data) && is_numeric($http_code))
373+
{
374+
$output = NULL;
375+
}
376+
371377
// Otherwise (if no data but 200 provided) or some data, carry on camping!
372378
else
373379
{

0 commit comments

Comments
 (0)