Fixing URI.parse issue causing errors when subdomains contain underscores