mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
Ensured that Request class is using unencoded-url header to avoid encoding issues on IIS (issue: #268)
This commit is contained in:
@@ -30,7 +30,10 @@ class Request
|
||||
{
|
||||
$this->parseHeaders();
|
||||
$this->setHost($this->getHeader('http-host'));
|
||||
$this->setUri(new Uri($this->getHeader('request-uri')));
|
||||
|
||||
// Check if special IIS header exist, otherwise use default.
|
||||
$this->setUri(new Uri($this->getHeader('unencoded-url', $this->getHeader('request-uri'))));
|
||||
|
||||
$this->input = new Input($this);
|
||||
$this->method = strtolower($this->input->get('_method', $this->getHeader('request-method'), 'post'));
|
||||
}
|
||||
@@ -164,7 +167,7 @@ class Request
|
||||
*/
|
||||
public function getHeader($name, $defaultValue = null)
|
||||
{
|
||||
if (isset($this->headers[strtolower($name)])) {
|
||||
if (array_key_exists(strtolower($name), $this->headers) === true) {
|
||||
return $this->headers[strtolower($name)];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user