Update index.js

Function isHttpURI now accept the allowHttps parameter.

Rewrite code to use new functionality