X-Git-Url: https://git.cweiske.de/anoweco.git/blobdiff_plain/8911cee78b9daf64a63471b2b3db4fa36aa8084f..adde8658ef641287cabdd04fecd8f8ae694f325c:/www/token.php diff --git a/www/token.php b/www/token.php index abe14ed..6a7fa81 100644 --- a/www/token.php +++ b/www/token.php @@ -47,7 +47,13 @@ if ($_SERVER['REQUEST_METHOD'] == 'GET') { } else { error('Authorization HTTP header missing'); } - list($bearer, $token) = explode(' ', $auth, 2); + + $parts = explode(' ', $auth, 2); + if (count($parts) != 2) { + error('Authorization header must container "Bearer" and the token'); + } + + list($bearer, $token) = $parts; if ($bearer !== 'Bearer') { error('Authorization header must start with "Bearer"'); }