mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Bugfixes
- Fixed host not set on request url. - Url returns relativeUrl when calling toString() to avoid any issues when using in RouteUrl(url()) for rewrites.
This commit is contained in:
@@ -395,6 +395,10 @@ class Request
|
||||
{
|
||||
$this->url = $url;
|
||||
|
||||
if ($this->getHost() !== null) {
|
||||
$url->setHost($this->getHost());
|
||||
}
|
||||
|
||||
if ($this->isSecure() === true) {
|
||||
$this->url->setScheme('https');
|
||||
}
|
||||
|
||||
@@ -541,7 +541,7 @@ class Url implements JsonSerializable
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->getHost(true) . $this->getRelativeUrl();
|
||||
return $this->getRelativeUrl();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user