api.py 文件源码

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

项目:nokia-deployer 作者: nokia 项目源码 文件源码
def method_not_allowed(res):
    if request.method == 'OPTIONS':
        new_res = bottle.HTTPResponse()
        new_res.set_header('Access-Control-Allow-Origin', '*')
        new_res.set_header('Access-Control-Allow-Methods', 'GET, POST, DELETE, PUT')
        new_res.set_header('Access-Control-Allow-Headers', 'X-Session-Token, X-Impersonate-Username, Content-Type')
        return new_res
    res.headers['Allow'] += ', OPTIONS'
    return request.app.default_error_handler(res)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号