mirror of
https://github.com/grocy/grocy.git
synced 2026-03-27 23:29:25 +01:00
Check for empty usernames in ReverseProxyAuthMiddleware (references #2843)
This commit is contained in:
parent
bf96ff5b92
commit
2a124a3d47
|
|
@ -40,7 +40,7 @@ class ReverseProxyAuthMiddleware extends AuthMiddleware
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$username = $request->getHeader(GROCY_REVERSE_PROXY_AUTH_HEADER);
|
$username = $request->getHeader(GROCY_REVERSE_PROXY_AUTH_HEADER);
|
||||||
if (count($username) !== 1)
|
if (count($username) !== 1 || (count($username) === 1 && strlen($username[0]) === 0))
|
||||||
{
|
{
|
||||||
// Invalid configuration of Proxy
|
// Invalid configuration of Proxy
|
||||||
throw new \Exception('ReverseProxyAuthMiddleware: ' . GROCY_REVERSE_PROXY_AUTH_HEADER . ' header is missing or invalid');
|
throw new \Exception('ReverseProxyAuthMiddleware: ' . GROCY_REVERSE_PROXY_AUTH_HEADER . ' header is missing or invalid');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user