Checks allowed methods against http method names and upper cases them for downstream usage.

This commit is contained in:
Billy Ferguson 2019-10-10 15:08:46 -04:00 committed by GitHub
parent 0fd72f17ee
commit 65017c73d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,7 +138,7 @@ class EndpointEnumerator:
http_method_names = set(callback.cls.http_method_names)
methods = [method.upper() for method in actions & http_method_names]
else:
methods = callback.cls().allowed_methods
methods = [method.upper() for method in callback.cls().allowed_methods & http_method_names]
return [method for method in methods if method not in ('OPTIONS', 'HEAD')]