mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Support for X-HTTP-Method-Override header
This commit is contained in:
parent
282af6057f
commit
9dccbcbb38
|
@ -231,9 +231,15 @@ class Request(object):
|
|||
"""
|
||||
self._content_type = self.META.get('HTTP_CONTENT_TYPE',
|
||||
self.META.get('CONTENT_TYPE', ''))
|
||||
|
||||
# Look for method override in header
|
||||
self._method = self.META.get('HTTP_X_HTTP_METHOD_OVERRIDE', None)
|
||||
if self._method:
|
||||
return
|
||||
|
||||
self._perform_form_overloading()
|
||||
# if the HTTP method was not overloaded, we take the raw HTTP method
|
||||
if not _hasattr(self, '_method'):
|
||||
if self._method:
|
||||
self._method = self._request.method
|
||||
|
||||
def _load_stream(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user