[fix] Fix cases where `url.host` is undefined
Merge pull request #218 from lpinca/fix/undefined-host

Fix cases where `url.host` is undefined