From 02ac330b3b0c3937922e6a1f3e836b3cbc268d28 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sat, 9 Jul 2016 13:19:07 +0200 Subject: [PATCH] Corrected exception handling, the app must stop the execution and through the exception response. --- src/application/controllers/api/v1/API_V1_Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/application/controllers/api/v1/API_V1_Controller.php b/src/application/controllers/api/v1/API_V1_Controller.php index e308f321..28be2367 100644 --- a/src/application/controllers/api/v1/API_V1_Controller.php +++ b/src/application/controllers/api/v1/API_V1_Controller.php @@ -46,7 +46,7 @@ class API_V1_Controller extends CI_Controller { $authorization = new \EA\Engine\Api\V1\Authorization($this); $authorization->basic($username, $password); } catch(\Exception $exception) { - $this->_handleException($exception); + exit($this->_handleException($exception)); } } @@ -56,7 +56,7 @@ class API_V1_Controller extends CI_Controller { protected function _requestAuthentication() { header('WWW-Authenticate: Basic realm="Easy!Appointments"'); header('HTTP/1.0 401 Unauthorized'); - echo 'You are not authorized to use the API.'; + exit('You are not authorized to use the API.'); } /**