mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
Ensure request method is compare to http_method_names of same case
Make sure both LHS and RHS are lower-cased in comparison for membership testing. Closes #8106
This commit is contained in:
parent
98e56e0327
commit
17539e6484
|
@ -497,7 +497,7 @@ class APIView(View):
|
|||
self.initial(request, *args, **kwargs)
|
||||
|
||||
# Get the appropriate handler method
|
||||
if request.method.lower() in self.http_method_names:
|
||||
if request.method.lower() in map(str.lower, self.http_method_names):
|
||||
handler = getattr(self, request.method.lower(),
|
||||
self.http_method_not_allowed)
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user