mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 13:09:44 +05:30
Wrapped getallheaders() method in function_exists (function isn't available on command line)
This commit is contained in:
parent
87ec05dba6
commit
465c1c6ab2
@ -127,13 +127,15 @@ class Server
|
||||
}
|
||||
|
||||
// Try and get an access token from the auth header
|
||||
$headers = getallheaders();
|
||||
if (isset($headers['Authorization'])) {
|
||||
if (function_exists('getallheaders')) {
|
||||
$headers = getallheaders();
|
||||
if (isset($headers['Authorization'])) {
|
||||
|
||||
$rawToken = trim(str_replace('Bearer', '', $headers['Authorization']));
|
||||
if ( ! empty($rawToken))
|
||||
{
|
||||
$accessToken = base64_decode($rawToken);
|
||||
$rawToken = trim(str_replace('Bearer', '', $headers['Authorization']));
|
||||
if ( ! empty($rawToken))
|
||||
{
|
||||
$accessToken = base64_decode($rawToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user