<commit_before>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)<commit_msg>github: Fix GitHub integration CSRF issue.<commit_after>from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from django.views.decorators.csrf import csrf_exempt
from .github_webhook import api_github_webhook
from .github import api_github_landing

# Since this dispatcher is an API-style endpoint, it needs to be
# explicitly marked as CSRF-exempt
@csrf_exempt
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)
{'fraction_non_alphanumeric': 0.0634469696969697, 'fraction_numerical': 0.0, 'mean_word_length': 5.406060606060606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4429947', 'n_tokens_mistral': 315, 'n_tokens_neox': 312, 'n_words': 82}