mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
Add github dispatcher to have one elegant url for both github integrations.
Dispatcher avoids to create new URL for github_webhook.
This commit is contained in:
12
zerver/views/webhooks/github_dispatcher.py
Normal file
12
zerver/views/webhooks/github_dispatcher.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user