routing.py 文件源码

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

项目:OVERWATCH 作者: raymondEhlers 项目源码 文件源码
def isSafeUrl(target):
    """ Checks URL for safety to ensure that it does not redirect unexpectedly.

    Args:
        target (str): URL for the target to test.

    Returns:
        bool: True if the URL is safe.

    """
    ref_url = urlparse(request.host_url)
    test_url = urlparse(urljoin(request.host_url, target))
    return test_url.scheme in ('http', 'https') and ref_url.netloc == test_url.netloc

###################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号