Skip to content

Commit 74bd607

Browse files
committed
♻️ Rewrite the port logic
1 parent 7a10283 commit 74bd607

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Proxy.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,11 @@ public function to($target)
6363

6464
$target = new Uri($target);
6565

66-
// Overwrite target scheme and host.
66+
// Overwrite target scheme, host and port.
6767
$uri = $this->request->getUri()
6868
->withScheme($target->getScheme())
69-
->withHost($target->getHost());
70-
71-
// Check for custom port.
72-
if ($port = $target->getPort()) {
73-
$uri = $uri->withPort($port);
74-
}
69+
->withHost($target->getHost())
70+
->withPort($target->getPort());
7571

7672
// Check for subdirectory.
7773
if ($path = $target->getPath()) {

0 commit comments

Comments
 (0)