Fixing an issue where a url passed without https can't be used if https is required. Also added a test to prevent that in the future.