Skip to content

Commit

Permalink
Merge pull request dingo#1201 from pulkitjalan/patch-2
Browse files Browse the repository at this point in the history
Allow internal requests via commands
  • Loading branch information
hskrasek authored Dec 27, 2016
2 parents 1f022fa + 402bf81 commit b09482e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,9 @@ protected function createRequest($verb, $uri, $parameters)

// If the URI does not have a scheme then we can assume that there it is not an
// absolute URI, in this case we'll prefix the root requests path to the URI.
if (! parse_url($uri, PHP_URL_SCHEME)) {
$uri = rtrim($this->getRootRequest()->root(), '/').'/'.ltrim($uri, '/');
$rootUrl = $this->getRootRequest()->root();
if ((! parse_url($uri, PHP_URL_SCHEME)) && parse_url($rootUrl) !== false) {
$uri = rtrim($rootUrl, '/').'/'.ltrim($uri, '/');
}

$request = InternalRequest::create(
Expand Down

0 comments on commit b09482e

Please sign in to comment.