zmirror.py 文件源码

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

项目:zmirror 作者: aploium 项目源码 文件源码
def extract_url_path_and_query(full_url=None, no_query=False):
    """
    Convert http://foo.bar.com/aaa/p.html?x=y to /aaa/p.html?x=y

    :param no_query:
    :type full_url: str
    :param full_url: full url
    :return: str
    """
    if full_url is None:
        full_url = request.url
    split = urlsplit(full_url)
    result = split.path or "/"
    if not no_query and split.query:
        result += '?' + split.query
    return result


# ################# End Client Request Handler #################


# ################# Begin Middle Functions #################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号