diff --git a/src/Headers.php b/src/Headers.php index d90f893..afde205 100644 --- a/src/Headers.php +++ b/src/Headers.php @@ -179,7 +179,15 @@ protected function normalizeHeaderName(string $name, bool $preserveCase = false) */ protected function parseAuthorizationHeader(array $headers): array { - if (!isset($headers['Authorization'])) { + $hasAuthorizationHeader = false; + foreach ($headers as $name => $value) { + if (strtolower($name) === 'authorization') { + $hasAuthorizationHeader = true; + break; + } + } + + if (!$hasAuthorizationHeader) { if (isset($this->globals['REDIRECT_HTTP_AUTHORIZATION'])) { $headers['Authorization'] = $this->globals['REDIRECT_HTTP_AUTHORIZATION']; } elseif (isset($this->globals['PHP_AUTH_USER'])) {