tonistiigi / mega

THIS REPO IS NOT MAINTAINED. Unofficial Node.js SDK for Mega
http://tonistiigi.github.com/mega
118 stars 33 forks source link

hostname instate of host ? #5

Closed anolek closed 11 years ago

anolek commented 11 years ago

"version": "0.0.9"

Hi, first of all, thanks for your module ! And sorry for my bad english.

When i do something with an url like "mega.co.nz:443/#hash!hash" (i need to use :port in url for some reasons), it says "Wrong URL Supplied".

It is because in /lib/mega.js near line 19, you use ".host" instate of ".hostname"

// "mega.co.nz:443" !== "mega.co.nz" if (url.host !== 'mega.co.nz' || !url.hash

But if we do // "mega.co.nz" !== "mega.co.nz" if (url.hostname !== 'mega.co.nz' || !url.hash

It works :)

tonistiigi commented 11 years ago

Thanks for reporting. Should be fixed now.