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)
评论列表
文章目录