diff options
author | Chris Rebert <code@rebertia.com> | 2014-06-17 13:02:18 +0400 |
---|---|---|
committer | Chris Rebert <code@rebertia.com> | 2014-06-17 13:02:18 +0400 |
commit | 675085408bd9ac434eb587537a04959b94ea334b (patch) | |
tree | e8dd287e702feb34d356b88995ccf5806dcdbb7c | |
parent | 0995e3a4e7d8f606d76f0048d51918c28e611a7d (diff) |
handle ping event
-rw-r--r-- | rorschach_webhook/rorschach/app.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rorschach_webhook/rorschach/app.py b/rorschach_webhook/rorschach/app.py index 302ea01..4fc8474 100644 --- a/rorschach_webhook/rorschach/app.py +++ b/rorschach_webhook/rorschach/app.py @@ -35,9 +35,12 @@ def verify_hub_signature(func): @app.route('/rorschach/', methods=['POST']) @verify_hub_signature def verify_deserialize_and_enqueue(): - if request.headers['X-Github-Event'] == 'pull_request': + event = request.headers['X-Github-Event'] + if event == 'pull_request': pull_req_payload = request.get_json() app.logger.info("Got payload: {!r}".format(pull_req_payload)) + elif event == 'ping': + app.logger.info("Successfully received ping event from GitHub") else: app.logger.info("Ignoring irrelevant event") return Response(b"OK", content_type=b'text/plain; charset=UTF-8') |