Add case insensitive lookup for headers gathered from the request made to the server.

This commit is contained in:
PJ Dietz 2012-12-28 17:25:35 -05:00
parent 40ca6bea87
commit d4f62642e7
1 changed files with 6 additions and 0 deletions

View File

@ -343,6 +343,12 @@ class Request extends Message {
$this->setBody(file_get_contents("php://input"), false); $this->setBody(file_get_contents("php://input"), false);
$this->headers = apache_request_headers(); $this->headers = apache_request_headers();
// Add case insensitive headers to the lookup table.
foreach ($this->headers as $key => $value) {
$this->headerLookup[strtolower($key)] = $key;
}
$this->method = $_SERVER['REQUEST_METHOD']; $this->method = $_SERVER['REQUEST_METHOD'];
$this->uri = $_SERVER['REQUEST_URI']; $this->uri = $_SERVER['REQUEST_URI'];
$this->hostname = $_SERVER['HTTP_HOST']; $this->hostname = $_SERVER['HTTP_HOST'];