Skip to content

Commit

Permalink
Merge pull request #614 from DeveloperMarius/non-ascii-chars-urlencoding
Browse files Browse the repository at this point in the history
urlencoding issue with non-ASCII chars in request-uri header
  • Loading branch information
skipperbent authored Feb 9, 2023
2 parents 9c79901 + 301c2cf commit b82e29c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Pecee/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,12 @@ public function __construct()
$this->setHost($this->getHeader('http-host'));

// Check if special IIS header exist, otherwise use default.
$this->setUrl(new Url($this->getFirstHeader(['unencoded-url', 'request-uri'])));
$url = $this->getHeader('unencoded-url');
if($url !== null){
$this->setUrl(new Url($url));
}else{
$this->setUrl(new Url(urldecode($this->getHeader('request-uri'))));
}
$this->setContentType((string)$this->getHeader('content-type'));
$this->setMethod((string)($_POST[static::FORCE_METHOD_KEY] ?? $this->getHeader('request-method')));
$this->inputHandler = new InputHandler($this);
Expand Down

0 comments on commit b82e29c

Please sign in to comment.