aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/request.py
diff options
context:
space:
mode:
authorTom Christie2013-03-15 19:25:12 +0000
committerTom Christie2013-03-15 19:25:12 +0000
commit1aedf57f4a1eb7261162977944fe233b00d63b59 (patch)
treeb091b5e765c5cbe03449961643b6887e5acb9b24 /rest_framework/request.py
parentb6b686d285e376dbf4f2d2f15bd0e3ef0f1c3a37 (diff)
parent22a389d0ba4dd5ac7b4fa3839491ec2708bbe7df (diff)
downloaddjango-rest-framework-1aedf57f4a1eb7261162977944fe233b00d63b59.tar.bz2
Merge branch 'master' into basic-nested-serialization
Diffstat (limited to 'rest_framework/request.py')
-rw-r--r--rest_framework/request.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/rest_framework/request.py b/rest_framework/request.py
index 3e2fbd88..ffbbab33 100644
--- a/rest_framework/request.py
+++ b/rest_framework/request.py
@@ -231,11 +231,17 @@ class Request(object):
"""
self._content_type = self.META.get('HTTP_CONTENT_TYPE',
self.META.get('CONTENT_TYPE', ''))
+
self._perform_form_overloading()
- # if the HTTP method was not overloaded, we take the raw HTTP method
+
if not _hasattr(self, '_method'):
self._method = self._request.method
+ if self._method == 'POST':
+ # Allow X-HTTP-METHOD-OVERRIDE header
+ self._method = self.META.get('HTTP_X_HTTP_METHOD_OVERRIDE',
+ self._method)
+
def _load_stream(self):
"""
Return the content body of the request, as a stream.