From 8a4f15d32c851d8cfeab77d4cff429a04d05806b Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 15 Feb 2016 13:36:29 +0100 Subject: [PATCH] Don't redirect unauthenticated API requests to the login page refs #11151 --- library/Icinga/Authentication/Auth.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/library/Icinga/Authentication/Auth.php b/library/Icinga/Authentication/Auth.php index 4e15c9512..2a9b18627 100644 --- a/library/Icinga/Authentication/Auth.php +++ b/library/Icinga/Authentication/Auth.php @@ -282,10 +282,7 @@ class Auth if ($request->isXmlHttpRequest() || ! $request->isApiRequest()) { return false; } - if (($header = $request->getHeader('Authorization')) === false) { - return false; - } - if (empty($header)) { + if (($header = $request->getHeader('Authorization')) === false || empty($header)) { $this->challengeHttp(); } list($scheme) = explode(' ', $header, 2);