cainus / urlgrey

url manipulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Port number not parsed correctly

hoyce opened this issue · comments

Hi!

When adding a parameter directly after the port, the port is not parsed correctly. It gets the value -2. The port number ends up in the obj.path() instead.

const obj = urlgrey('http://host.com:123?q=e')
obj.port() -> -2
obj.path() -> /:123

The expected behaviour would be:
const obj = urlgrey('http://host.com:123?q=e')
obj.port() -> 123
obj.path() -> ''