mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 06:14:47 +03:00
Correctly report allowed methods
This commit is contained in:
parent
d322c3fa4b
commit
b9dec98647
|
@ -129,7 +129,12 @@ class APIView(View):
|
|||
"""
|
||||
Wrap Django's private `_allowed_methods` interface in a public property.
|
||||
"""
|
||||
return self._allowed_methods()
|
||||
allowed_methods = self._allowed_methods()
|
||||
|
||||
if not api_settings.SUPPORT_PATCH and 'PATCH' in allowed_methods:
|
||||
allowed_methods.remove('PATCH')
|
||||
|
||||
return allowed_methods
|
||||
|
||||
@property
|
||||
def default_response_headers(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user