Navigation Menu

Skip to content

Commit

Permalink
Fix Uri query string not getting set.
Browse files Browse the repository at this point in the history
When the `url` option is used, the query string if present should be set
into the Uri instance. This makes it match up with the `query` property.
  • Loading branch information
markstory committed Jan 5, 2017
1 parent 7716434 commit b07eb68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Http/ServerRequest.php
Expand Up @@ -314,6 +314,9 @@ protected function _setConfig($config)
if ($config['url']) {
$uri = $uri->withPath('/' . $config['url']);
}
if (strlen($querystr)) {
$uri = $uri->withQuery($querystr);
}

$this->uri = $uri;
$this->base = $config['base'];
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Network/RequestTest.php
Expand Up @@ -172,6 +172,7 @@ public function testQueryStringParsingFromInputUrl()
$expected = ['one' => 'something', 'two' => 'else'];
$this->assertEquals($expected, $request->query);
$this->assertEquals('some/path', $request->url);
$this->assertEquals('one=something&two=else', $request->getUri()->getQuery());
}

/**
Expand Down

0 comments on commit b07eb68

Please sign in to comment.