Check for empty usernames in ReverseProxyAuthMiddleware (references #2843)

This commit is contained in:
Bernd Bestel 2026-01-13 21:02:30 +01:00
parent bf96ff5b92
commit 2a124a3d47
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300

View File

@ -40,7 +40,7 @@ class ReverseProxyAuthMiddleware extends AuthMiddleware
else
{
$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
throw new \Exception('ReverseProxyAuthMiddleware: ' . GROCY_REVERSE_PROXY_AUTH_HEADER . ' header is missing or invalid');