Lower case comparison for http_method_names

Ref Issue: https://github.com/encode/django-rest-framework/issues/8753

Co-authored-by: Abhishek Rana <arana@thesummitgrp.com>
This commit is contained in:
Jatin Goel 2022-11-09 18:06:07 +05:30 committed by GitHub
parent 56946fac8f
commit 33aec44ecc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: