Skip to content

Commit

Permalink
Update Header.php
Browse files Browse the repository at this point in the history
  • Loading branch information
edenleung authored Apr 12, 2021
1 parent 408768d commit 0dff0b9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Handle/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ public function handle()
{
$authorization = $this->app->request->header('authorization');

if (!$authorization || strpos($authorization, 'Bearer ') !== 0) {
if (!$authorization) {
return;
}

return substr($authorization, 7);
if (strpos($authorization, 'Bearer ') === 0) {
return substr($authorization, 7);
} else {
return $authorization;
}
}
}

0 comments on commit 0dff0b9

Please sign in to comment.