mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 00:04:16 +03:00
Modified to allow form overloading to take precedence over header.
This commit is contained in:
parent
9dccbcbb38
commit
104614c600
|
@ -232,15 +232,12 @@ class Request(object):
|
||||||
self._content_type = self.META.get('HTTP_CONTENT_TYPE',
|
self._content_type = self.META.get('HTTP_CONTENT_TYPE',
|
||||||
self.META.get('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()
|
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:
|
# Method wasn't overloaded by hidden form element, so look for
|
||||||
self._method = self._request.method
|
# method override in header. If not present default to raw HTTP method
|
||||||
|
self._method = self.META.get('HTTP_X_HTTP_METHOD_OVERRIDE',
|
||||||
|
self._request.method)
|
||||||
|
|
||||||
def _load_stream(self):
|
def _load_stream(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user