Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sentry/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,7 @@
method_dispatch(
GET=OrganizationMonitorCheckInIndexEndpoint.as_view(),
POST=MonitorIngestCheckInIndexEndpoint.as_view(), # Legacy ingest endpoint
csrf_exempt=True,
),
name="sentry-api-0-organization-monitor-check-in-index",
),
Expand Down
4 changes: 4 additions & 0 deletions src/sentry/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from django.http import HttpResponseNotAllowed
from django.utils import timezone
from django.views.decorators.csrf import csrf_exempt
from rest_framework.request import Request

from sentry import options
Expand Down Expand Up @@ -283,4 +284,7 @@ def dispatcher(request, *args, **kwargs): # type: ignore[no-untyped-def]
handler = dispatch_mapping.get(request.method, invalid_method)
return handler(request, *args, **kwargs)

if dispatch_mapping.get("csrf_exempt"):
return csrf_exempt(dispatcher)

return dispatcher