Files
zulip/zerver/views/webhooks/github_dispatcher.py
Tomasz Kolek bb6d189fa8 Add github dispatcher to have one elegant url for both github integrations.
Dispatcher avoids to create new URL for github_webhook.
2016-12-15 17:42:28 -08:00

13 lines
405 B
Python

from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from .github_webhook import api_github_webhook
from .github import api_github_landing
def api_github_webhook_dispatch(request):
# type: (HttpRequest) -> HttpResponse
if request.META.get('HTTP_X_GITHUB_EVENT'):
return api_github_webhook(request)
else:
return api_github_landing(request)