diff options
| author | Tom Christie | 2012-10-08 17:10:50 +0100 | 
|---|---|---|
| committer | Tom Christie | 2012-10-08 17:10:50 +0100 | 
| commit | 4a21b3557edb3b901b86d3a888c44f772e33b922 (patch) | |
| tree | b54cc491fffd9c7ddd90a414112072aa5562222e /rest_framework/request.py | |
| parent | b581ffe323d88b6740abfed0fd552cc436fd2dcc (diff) | |
| download | django-rest-framework-4a21b3557edb3b901b86d3a888c44f772e33b922.tar.bz2 | |
Fix fiddly content-overloading bug
Diffstat (limited to 'rest_framework/request.py')
| -rw-r--r-- | rest_framework/request.py | 8 | 
1 files changed, 3 insertions, 5 deletions
| diff --git a/rest_framework/request.py b/rest_framework/request.py index ac15defc..3ce93181 100644 --- a/rest_framework/request.py +++ b/rest_framework/request.py @@ -227,16 +227,14 @@ class Request(object):              self._method = self._data[self._METHOD_PARAM].upper()              self._data.pop(self._METHOD_PARAM) -        # Content overloading - modify the content type, and re-parse. +        # Content overloading - modify the content type, and force 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[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() +            self._data, self._files = (Empty, Empty)      def _parse(self):          """ @@ -250,7 +248,7 @@ class Request(object):          parser = self.negotiator.select_parser(self.parsers, self.content_type)          if not parser: -            raise exceptions.UnsupportedMediaType(self._content_type) +            raise exceptions.UnsupportedMediaType(self.content_type)          parsed = parser.parse(self.stream, meta=self.META,                                upload_handlers=self.upload_handlers) | 
