openRedirect.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:AutoTriageBot 作者: salesforce 项目源码 文件源码
def testGETOpenRedirect(url: str, cookies: Mapping[str, str]) -> Optional[str]:
    """ If the given URL redirects when accessed with the given cookies via GET, return the new URL, otherwise
        return None """
    driver = SeleniumDrivers.getFirefoxDriver()
    driver.setCookies(url, cookies)

    try:
        driver.get(url)

        time.sleep(config.timeout)

        if driver.current_url == url:
            driver.reset()
            return None
        else:
            url = driver.current_url
            driver.reset()
            return url
    except (TimeoutException, URLError):
        driver.reset()
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号