app.py 文件源码

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

项目:github-pr-closer 作者: jirutka 项目源码 文件源码
def post_index():
    event_type = request.get_header('X-GitHub-Event')

    if not is_request_from_github():
        abort(403, "Forbidden for IP %s, it's not GitHub's address" % remote_ip())

    if request.content_type.split(';')[0] != 'application/json':
        abort(415, "Expected application/json, but got %s" % request.content_type)

    if event_type == 'ping':
        return handle_ping()

    elif event_type == 'push':
        return handle_push()

    else:
        abort(400, "Unsupported event type: %s" % event_type)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号