Skip to content

Commit

Permalink
Fix port in absolute Url (#36)
Browse files Browse the repository at this point in the history
Add a missing colon before the port in the url.
From `http://hostport` to `http://host:port`
  • Loading branch information
hlaCk authored Mar 26, 2021
1 parent 7af4600 commit 425e6d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/UrlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct($url)
*/
public function build($absolute = true)
{
$host = $absolute ? $this->get('scheme') . '://' . $this->get('host') . $this->get('port') : '';
$host = $absolute ? $this->get('scheme') . '://' . $this->get('host') . (($port = $this->get('port')) ? ":{$port}": '') : '';
$path = '/' . trim($this->get('path'), '/');
$query = $this->get('query') ? '?' . $this->get('query') : '';

Expand Down

0 comments on commit 425e6d2

Please sign in to comment.