From 957a382248495f0d6e18187456ac6b2429923754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sessing=C3=B8?= Date: Thu, 24 Aug 2017 02:04:11 +0100 Subject: [PATCH] Ensured that Request class is using unencoded-url header to avoid encoding issues on IIS (issue: #268) --- src/Pecee/Http/Request.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Pecee/Http/Request.php b/src/Pecee/Http/Request.php index 91cb994..dedf144 100644 --- a/src/Pecee/Http/Request.php +++ b/src/Pecee/Http/Request.php @@ -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)]; }