Ticket #5611: 5611.diff

File 5611.diff, 1.4 KB (added by claudep, 3 years ago)

Patch updated to current trunk

  • django/http/__init__.py

    diff --git a/django/http/__init__.py b/django/http/__init__.py
    index 2f3392f..c463bd4 100644
    a b class HttpRequest(object): 
    311311        self._post_parse_error = True
    312312
    313313    def _load_post_and_files(self):
    314         # Populates self._post and self._files
     314        """ Populates self._post and self._files if the content-type is a form type """
    315315        if self.method != 'POST':
    316316            self._post, self._files = QueryDict('', encoding=self._encoding), MultiValueDict()
    317317            return
    class HttpRequest(object): 
    319319            self._mark_post_parse_error()
    320320            return
    321321
    322         if self.META.get('CONTENT_TYPE', '').startswith('multipart'):
     322        if self.META.get('CONTENT_TYPE', '').startswith('multipart/form-data'):
    323323            if hasattr(self, '_body'):
    324324                # Use already read data
    325325                data = StringIO(self._body)
    class HttpRequest(object): 
    337337                # empty POST
    338338                self._mark_post_parse_error()
    339339                raise
    340         else:
     340        elif self.META.get('CONTENT_TYPE', '').startswith('application/x-www-form-urlencoded'):
    341341            self._post, self._files = QueryDict(self.body, encoding=self._encoding), MultiValueDict()
     342        else:
     343            self._post, self._files = QueryDict(''), MultiValueDict()
    342344
    343345    ## File-like and iterator interface.
    344346    ##
Back to Top