From e17166596a6f199b28ff3dad6c2d31da845b913e Mon Sep 17 00:00:00 2001 From: Ulrich Schmidt-Goertz Date: Thu, 3 Apr 2014 15:52:35 +0200 Subject: [PATCH] Allow basic auth with empty username --- Middleware/HttpBasicAuth.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Middleware/HttpBasicAuth.php b/Middleware/HttpBasicAuth.php index d473b8d..d56e311 100644 --- a/Middleware/HttpBasicAuth.php +++ b/Middleware/HttpBasicAuth.php @@ -81,7 +81,8 @@ public function call() $res = $this->app->response(); $authUser = $req->headers('PHP_AUTH_USER'); $authPass = $req->headers('PHP_AUTH_PW'); - if ($authUser && $authPass && $authUser === $this->username && $authPass === $this->password) { + if (is_string($authUser) && is_string($authPass) + && $authUser === $this->username && $authPass === $this->password) { $this->next->call(); } else { $res->status(401);