Correctly report allowed methods

This commit is contained in:
José Padilla 2015-06-26 11:51:24 -04:00
parent d322c3fa4b
commit b9dec98647

View File

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