diff options
| author | Tom Christie | 2012-09-07 10:57:04 +0100 |
|---|---|---|
| committer | Tom Christie | 2012-09-07 10:57:04 +0100 |
| commit | 071e7d72cd3d0f48bd3c0f8e22da319a9c4d4a09 (patch) | |
| tree | 089dced8775be183bd7b44b6810f98c1c3f79c7f /djangorestframework/request.py | |
| parent | b8559c619288be71d1f0709d3c4e622580da7e2d (diff) | |
| download | django-rest-framework-071e7d72cd3d0f48bd3c0f8e22da319a9c4d4a09.tar.bz2 | |
Fix method overloading
Diffstat (limited to 'djangorestframework/request.py')
| -rw-r--r-- | djangorestframework/request.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/djangorestframework/request.py b/djangorestframework/request.py index 5bf7b23c..83ee47c6 100644 --- a/djangorestframework/request.py +++ b/djangorestframework/request.py @@ -211,16 +211,18 @@ class Request(object): # Method overloading - change the method and remove the param from the content. if (self._METHOD_PARAM and self._METHOD_PARAM in self._data): - # NOTE: `pop` on a `QueryDict` returns a list of values. - self._method = self._data.pop(self._METHOD_PARAM)[0].upper() + self._method = self._data[self._METHOD_PARAM].upper() + self._data.pop(self._METHOD_PARAM) # Content overloading - modify the content type, and re-parse. if (self._CONTENT_PARAM and self._CONTENTTYPE_PARAM and self._CONTENT_PARAM in self._data and self._CONTENTTYPE_PARAM in self._data): - self._content_type = self._data.pop(self._CONTENTTYPE_PARAM)[0] - self._stream = StringIO(self._data.pop(self._CONTENT_PARAM)[0]) + self._content_type = self._data[self._CONTENTTYPE_PARAM] + self._stream = StringIO(self._data[self._CONTENT_PARAM]) + self._data.pop(self._CONTENTTYPE_PARAM) + self._data.pop(self._CONTENT_PARAM) self._data, self._files = self._parse() def _parse(self): |
