Skip to content

Commit 3dd9dba

Browse files
committed
[FEATURE] All headers in Request class now has lowercased keys.
1 parent be277f2 commit 3dd9dba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Pecee/Http/Request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct() {
2727
$this->host = $_SERVER['HTTP_HOST'];
2828
$this->uri = $_SERVER['REQUEST_URI'];
2929
$this->method = (isset($_POST['_method'])) ? strtolower($_POST['_method']) : strtolower($_SERVER['REQUEST_METHOD']);
30-
$this->headers = getallheaders();
30+
$this->headers = array_change_key_case(getallheaders(), CASE_LOWER);
3131
}
3232

3333
/**
@@ -105,7 +105,7 @@ public function getUserAgent() {
105105
* @return string|null
106106
*/
107107
public function getHeader($name) {
108-
return (isset($this->headers[$name])) ? $this->headers[$name] : null;
108+
return (isset($this->headers[strtolower($name)])) ? $this->headers[strtolower($name)] : null;
109109
}
110110

111111
/**

0 commit comments

Comments
 (0)