auth.py 文件源码

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

项目:zeus 作者: getsentry 项目源码 文件源码
def is_safe_url(target: str) -> bool:
    ref_url = urlparse(request.host_url)
    test_url = urlparse(urljoin(request.host_url, target))
    return (
        # same scheme
        test_url.scheme in ('http', 'https') and
        # same host and port
        ref_url.netloc == test_url.netloc and
        # and different endoint
        ref_url.path != test_url.path
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号