Skip to content

Commit 90418eb

Browse files
committed
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.
1 parent 0634ba7 commit 90418eb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Pecee/Http/Request.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,10 @@ public function setUrl(Url $url): void
395395
{
396396
$this->url = $url;
397397

398+
if ($this->getHost() !== null) {
399+
$url->setHost($this->getHost());
400+
}
401+
398402
if ($this->isSecure() === true) {
399403
$this->url->setScheme('https');
400404
}

src/Pecee/Http/Url.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ public function jsonSerialize(): string
541541

542542
public function __toString(): string
543543
{
544-
return $this->getHost(true) . $this->getRelativeUrl();
544+
return $this->getRelativeUrl();
545545
}
546546

547547
}

0 commit comments

Comments
 (0)