From 90418eb41c9d4cc6d0f036e81307892b3bcfacf6 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 6 Nov 2024 11:05:43 +0100 Subject: [PATCH] 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. --- src/Pecee/Http/Request.php | 4 ++++ src/Pecee/Http/Url.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Pecee/Http/Request.php b/src/Pecee/Http/Request.php index e9f9742..642cd1b 100644 --- a/src/Pecee/Http/Request.php +++ b/src/Pecee/Http/Request.php @@ -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'); } diff --git a/src/Pecee/Http/Url.php b/src/Pecee/Http/Url.php index 7b15ae4..a76f733 100644 --- a/src/Pecee/Http/Url.php +++ b/src/Pecee/Http/Url.php @@ -541,7 +541,7 @@ class Url implements JsonSerializable public function __toString(): string { - return $this->getHost(true) . $this->getRelativeUrl(); + return $this->getRelativeUrl(); } } \ No newline at end of file