From 33aec44ecc55620933e9904a96db746a8e62cb19 Mon Sep 17 00:00:00 2001 From: Jatin Goel Date: Wed, 9 Nov 2022 18:06:07 +0530 Subject: [PATCH] Lower case comparison for http_method_names Ref Issue: https://github.com/encode/django-rest-framework/issues/8753 Co-authored-by: Abhishek Rana --- rest_framework/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/views.py b/rest_framework/views.py index 4c30029fd..0863e32b7 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -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 list(map(lambda x: x.lower(), self.http_method_names)): handler = getattr(self, request.method.lower(), self.http_method_not_allowed) else: