mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
bypass permission checks for OPTIONS requests
OPTIONS requests, ala CORS, do not supply authentication arguments.
This commit is contained in:
parent
cf52c0e044
commit
a2ff6b7285
|
@ -294,8 +294,8 @@ class APIView(View):
|
||||||
"""
|
"""
|
||||||
self.format_kwarg = self.get_format_suffix(**kwargs)
|
self.format_kwarg = self.get_format_suffix(**kwargs)
|
||||||
|
|
||||||
# Ensure that the incoming request is permitted
|
# Ensure that the incoming request is permitted. OPTIONS requests are always permitted.
|
||||||
if not self.has_permission(request):
|
if request.method != 'OPTIONS' and not self.has_permission(request):
|
||||||
self.permission_denied(request)
|
self.permission_denied(request)
|
||||||
self.check_throttles(request)
|
self.check_throttles(request)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user