joyent/node — pull request #2918 by morkai (2012-03-12 19:34:51+00:00)
Title: Ignore an empty port component when parsing URLs.

According to [RFC 2396 - Uniform Resource Identifiers (URI): Generic Syntax](http://tools.ietf.org/html/rfc2396#appendix-A) a port component can be empty (0 or more digits), but currently, parsing the following URL in Node.js `http://example.com:/a/b/c` results in `:` being prepended to a path component (`/:/a/b/c`).

Parsing that URL in PHP, Java or Python results in a path equal to `/a/b/c` and a port not being available.

The attached changes make the `url.parse()` ignore the empty port value.