-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Description
I use laragon for local development and running
I first noticed something like url('home.test')->getAbsoluteUrl()
only returned the path (no scheme, no host)
After trying with request()->getUrl()->getAbsoluteUrl()
the scheme showed here, but the host was empty
The above code produced this "https:///_manage/test/"
On inspection, i made this change in Pecee\Http\Request
$this->setHost($this->getHeader('http-host'));
// Check if special IIS header exist, otherwise use default.
$url = $this->getHeader('unencoded-url');
if ($url !== null) {
$this->setUrl(new Url($url));
} else {
$this->setUrl(new Url(urldecode((string)$this->getHeader('request-uri'))));
}
$this->url->setHost($this->host); // change: since host has already been set
$this->setContentType((string)$this->getHeader('content-type'));
and everything worked fine for:
var_dump(request()->getUrl()->getAbsoluteUrl());
var_dump(\url()->getAbsoluteUrl());
But url('home.page')->getAbsoluteUrl()
still returned only the path (without the host & scheme)
If you could look into this. I can provide more information if you need
Metadata
Metadata
Assignees
Labels
No labels