mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-22 07:52:29 +03:00
Minor formatting changes in API_V1_Controller.php
This commit is contained in:
parent
f05a4be918
commit
395b329e78
1 changed files with 7 additions and 2 deletions
|
@ -75,7 +75,9 @@ class API_V1_Controller extends CI_Controller {
|
|||
protected function _getBearerToken()
|
||||
{
|
||||
$headers = $this->_getAuthorizationHeader();
|
||||
|
||||
// HEADER: Get the access token from the header
|
||||
|
||||
if ( ! empty($headers))
|
||||
{
|
||||
if (preg_match('/Bearer\s(\S+)/', $headers, $matches))
|
||||
|
@ -109,15 +111,18 @@ class API_V1_Controller extends CI_Controller {
|
|||
elseif (function_exists('apache_request_headers'))
|
||||
{
|
||||
$requestHeaders = apache_request_headers();
|
||||
// Server-side fix for bug in old Android versions (a nice side-effect of this fix means we don't care about capitalization for Authorization)
|
||||
|
||||
// Server-side fix for bug in old Android versions (a nice side-effect of this fix means we don't care
|
||||
// about capitalization for Authorization).
|
||||
$requestHeaders = array_combine(array_map('ucwords', array_keys($requestHeaders)), array_values($requestHeaders));
|
||||
//print_r($requestHeaders);
|
||||
|
||||
if (isset($requestHeaders['Authorization']))
|
||||
{
|
||||
$headers = trim($requestHeaders['Authorization']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $headers;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue