Skip to content

Commit 609ab39

Browse files
committed
Disable CSRF protection for idx and graphql
1 parent e4acb6e commit 609ab39

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backend/settings/urls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from django.conf.urls.static import static
99
from django.contrib import admin
1010
from django.urls import include, path
11-
from django.views.decorators.csrf import csrf_protect
11+
from django.views.decorators.csrf import csrf_exempt
1212
from graphene_django.views import GraphQLView
1313
from rest_framework import routers
1414

@@ -22,8 +22,8 @@
2222
router.registry.extend(owasp_router.registry)
2323

2424
urlpatterns = [
25-
path("idx/", csrf_protect(algolia_search)),
26-
path("graphql/", csrf_protect(GraphQLView.as_view(graphiql=settings.DEBUG))),
25+
path("idx/", csrf_exempt(algolia_search)),
26+
path("graphql/", csrf_exempt(GraphQLView.as_view(graphiql=settings.DEBUG))),
2727
path("api/v1/", include(router.urls)),
2828
path("a/", admin.site.urls),
2929
]

0 commit comments

Comments
 (0)