diff --git a/lib/Unirest/Unirest.php b/lib/Unirest/Unirest.php index db59943..5b12841 100644 --- a/lib/Unirest/Unirest.php +++ b/lib/Unirest/Unirest.php @@ -133,6 +133,10 @@ class Unirest // Encode and build query based on RFC 1738 $query = '?'.http_build_query($query_parsed); } + + // Handle port seperator + if ($port && $port[0] != ":") + $port = ":" . $port; // Return the completed URL $result = $scheme . $host . $port . $path . $query; @@ -182,4 +186,4 @@ function is_hex($hex) { if (empty($hex)) { $hex = 0; }; $dec = hexdec($hex); return ($hex == dechex($dec)); -} \ No newline at end of file +}