Update index.js

In the documentation is not specified that when using an object instead of a string for the url parameter, hostname key must be used instead of host. I think checking for host and hostname keys should be the right way to handle it.