mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Work around Apache handling the Authorization: header differently
This commit is contained in:
parent
0a22058e35
commit
acc32f5c58
1 changed files with 7 additions and 2 deletions
|
@ -748,7 +748,12 @@ class CakeRequest implements ArrayAccess {
|
|||
* @return mixed Either false on no header being set or the value of the header.
|
||||
*/
|
||||
public static function header($name) {
|
||||
$name = 'HTTP_' . strtoupper(str_replace('-', '_', $name));
|
||||
$http_name = 'HTTP_' . strtoupper(str_replace('-', '_', $name));
|
||||
if (isset($_SERVER[$http_name])) {
|
||||
return $_SERVER[$http_name];
|
||||
}
|
||||
// Work around Apache issue handling the "Authorization" header
|
||||
// differently than other headers.
|
||||
if (isset($_SERVER[$name])) {
|
||||
return $_SERVER[$name];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue