utils.py 文件源码

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

项目:learneveryword 作者: karan 项目源码 文件源码
def parse_authorization_header(authorization_header):
    """Parse an OAuth authorization header into a list of 2-tuples"""
    auth_scheme = 'OAuth '.lower()
    if authorization_header[:len(auth_scheme)].lower().startswith(auth_scheme):
        items = parse_http_list(authorization_header[len(auth_scheme):])
        try:
            return list(parse_keqv_list(items).items())
        except (IndexError, ValueError):
            pass
    raise ValueError('Malformed authorization header')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号