[FEATURE] All headers in Request class now has lowercased keys.

This commit is contained in:
Simon Sessingø
2015-11-01 10:13:00 +01:00
parent be277f276f
commit 3dd9dba029
+2 -2
View File
@@ -27,7 +27,7 @@ class Request {
$this->host = $_SERVER['HTTP_HOST'];
$this->uri = $_SERVER['REQUEST_URI'];
$this->method = (isset($_POST['_method'])) ? strtolower($_POST['_method']) : strtolower($_SERVER['REQUEST_METHOD']);
$this->headers = getallheaders();
$this->headers = array_change_key_case(getallheaders(), CASE_LOWER);
}
/**
@@ -105,7 +105,7 @@ class Request {
* @return string|null
*/
public function getHeader($name) {
return (isset($this->headers[$name])) ? $this->headers[$name] : null;
return (isset($this->headers[strtolower($name)])) ? $this->headers[strtolower($name)] : null;
}
/**