Skip to content

Commit 34b3fdc

Browse files
author
Chris Kacerguis
committed
set correct response code
1 parent 5457bec commit 34b3fdc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

application/libraries/REST_Controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public function __construct()
293293
// only allow ajax requests
294294
if (!$this->input->is_ajax_request() and config_item('rest_ajax_only')) {
295295
$response = array('status' => false, 'error' => 'Only AJAX requests are accepted.')
296-
$this->response($response, 505);
296+
$this->response($response, 406); // Set status to 406 NOT ACCEPTABLE
297297
}
298298

299299
// When there is no specific override for the current class/method, use the default auth value set in the config
@@ -349,7 +349,7 @@ public function _remap($object_called, $arguments)
349349
}
350350

351351
$pattern = '/^(.*)\.('.implode('|', array_keys($this->_supported_formats)).')$/';
352-
352+
353353
if (preg_match($pattern, $object_called, $matches)) {
354354
$object_called = $matches[1];
355355
}

0 commit comments

Comments
 (0)