def is_redirect_from_http_to_https(response):
    if (response.status_code == 302):
        oldurl = response.url
        newurl = response.headers['location']
        if (oldurl.startswith('http://') and (oldurl.replace('http', 'https') == newurl)):
            return True
    return False
def is_redirect_from_http_to_https(response):
    if (response.status_code == 302):
        oldurl = response.url
        newurl = response.headers['location']
        if (oldurl.startswith('http://') and (oldurl.replace('http', 'https') == newurl)):
            return True
    return False