auth.py 文件源码

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

项目:ambassador 作者: datawire 项目源码 文件源码
def catch_all(path):
    if not path.startswith('/'):
        path = '/' + path

    resp = Response('You want path: %s' % path)

    if path.startswith('/ambassador/'):
        resp.status_code = 200     
    elif path.endswith("/good/") or path.endswith("/demo/"):
        resp.status_code = 200
        resp.headers['X-Hurkle'] = 'Oh baby, oh baby.'
    elif path.endswith("/nohdr/"):
        resp.status_code = 200
        # Don't add the header.
    else:
        resp.status_code = 403

    resp.headers['X-Test'] = 'Should not be seen.'
    return resp
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号