Skip to content

Commit

Permalink
Do not authorize empty Authorization headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwang401 committed Aug 14, 2022
1 parent 5e21cdd commit 80c7f1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Http/Middleware/AuthorizeProprietaryToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public function handle(Request $request, Closure $next)
{
$secret = $request->header('Authorization');

if ($secret !== config('external.secret'))

if ($secret !== config('external.secret') || strlen(config('external.secret')) === 0 || empty(config('external.secret')))
{
return new Response([
'message' => 'Unauthorized'
Expand Down

0 comments on commit 80c7f1b

Please sign in to comment.