Closed
Description
I've observed that if a URL with port specified, and scheme unspecified, is supplied to url.parse, the hostname is set as protocol, and port as hostname in the result:
$ node
> var url = require('url');
undefined
> url.parse('localhost:8080/foo/bar');
{ protocol: 'localhost:',
slashes: null,
auth: null,
host: '8080',
port: null,
hostname: '8080',
hash: null,
search: null,
query: null,
pathname: '/foo/bar',
path: '/foo/bar',
href: 'localhost:8080/foo/bar' }
>
I'm unsure of whether this is a bug, but I figured I'd report the behavior. I'm using version v0.12.7, on OS X.