Skip to content

Commit

Permalink
Only assign $host once.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Jan 8, 2017
1 parent b985968 commit 8d22f33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Routing/RouteCollection.php
Expand Up @@ -160,12 +160,12 @@ public function parseRequest(ServerRequestInterface $request)
$uri = $request->getUri();
$method = $request->getMethod();
$urlPath = $uri->getPath();
$host = $uri->getHost();
foreach (array_keys($this->_paths) as $path) {
if (strpos($urlPath, $path) !== 0) {
continue;
}

$host = $uri->getHost();
/* @var \Cake\Routing\Route\Route $route */
foreach ($this->_paths[$path] as $route) {
if (!$route->hostMatches($host)) {
Expand Down

0 comments on commit 8d22f33

Please sign in to comment.