Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Unirest/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,12 +555,16 @@ private static function encodeUrl($url)
$query = '?' . http_build_query(self::getArrayFromQuerystring($query));
}

// Because it is a numeric port and it can not be received as an array
// And you have to turn it into a string
// $port[0] has it error
$port = "$port";

if ($port && $port[0] !== ':') {
$port = ':' . $port;
}

$result = $scheme . $host . $port . $path . $query;
return $result;
return $scheme . $host . $port . $path . $query;
}

private static function getHeaderString($key, $val)
Expand Down