Fix to handle both http and https urls.