Compare commits

...

2 Commits

Author SHA1 Message Date
Simon 301d551981 Fix host url 2024-11-10 23:20:08 +01:00
Simon 90418eb41c 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.
2024-11-06 11:05:43 +01:00
2 changed files with 7 additions and 3 deletions
+4
View File
@@ -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');
}
+3 -3
View File
@@ -75,8 +75,8 @@ class Url implements JsonSerializable
if ($url !== null) {
$data = $this->parseUrl($url);
$this->scheme = $data['scheme'] ?? null;
$this->host = $data['host'] ?? null;
$this->scheme = $data['scheme'] ?? $this->scheme;
$this->host = $data['host'] ?? $this->host;
$this->port = $data['port'] ?? null;
$this->username = $data['user'] ?? null;
$this->password = $data['pass'] ?? null;
@@ -541,7 +541,7 @@ class Url implements JsonSerializable
public function __toString(): string
{
return $this->getHost(true) . $this->getRelativeUrl();
return $this->getRelativeUrl();
}
}