mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
check allowed methods before checking permissions and stuff
This commit is contained in:
parent
48a2f084aa
commit
36639f4765
|
@ -451,10 +451,10 @@ class APIView(View):
|
|||
self.headers = self.default_response_headers # deprecate?
|
||||
|
||||
try:
|
||||
self.initial(request, *args, **kwargs)
|
||||
|
||||
# Get the appropriate handler method
|
||||
if request.method.lower() in self.http_method_names:
|
||||
self.initial(request, *args, **kwargs)
|
||||
|
||||
handler = getattr(self, request.method.lower(),
|
||||
self.http_method_not_allowed)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user