[fix] Fix cases where `url.host` is undefined