Refs #22897 -- Removed unneeded empty string QueryDict argument.
This commit is contained in:
parent
ac77c55bc5
commit
ead21a1949
|
@ -120,7 +120,7 @@ class MultiPartParser(object):
|
||||||
# HTTP spec says that Content-Length >= 0 is valid
|
# HTTP spec says that Content-Length >= 0 is valid
|
||||||
# handling content-length == 0 before continuing
|
# handling content-length == 0 before continuing
|
||||||
if self._content_length == 0:
|
if self._content_length == 0:
|
||||||
return QueryDict('', encoding=self._encoding), MultiValueDict()
|
return QueryDict(encoding=self._encoding), MultiValueDict()
|
||||||
|
|
||||||
# See if any of the handlers take care of the parsing.
|
# See if any of the handlers take care of the parsing.
|
||||||
# This allows overriding everything if need be.
|
# This allows overriding everything if need be.
|
||||||
|
@ -135,7 +135,7 @@ class MultiPartParser(object):
|
||||||
return result[0], result[1]
|
return result[0], result[1]
|
||||||
|
|
||||||
# Create the data structures to be used later.
|
# Create the data structures to be used later.
|
||||||
self._post = QueryDict('', mutable=True)
|
self._post = QueryDict(mutable=True)
|
||||||
self._files = MultiValueDict()
|
self._files = MultiValueDict()
|
||||||
|
|
||||||
# Instantiate the parser and stream:
|
# Instantiate the parser and stream:
|
||||||
|
|
|
@ -267,14 +267,14 @@ class HttpRequest(object):
|
||||||
return self._body
|
return self._body
|
||||||
|
|
||||||
def _mark_post_parse_error(self):
|
def _mark_post_parse_error(self):
|
||||||
self._post = QueryDict('')
|
self._post = QueryDict()
|
||||||
self._files = MultiValueDict()
|
self._files = MultiValueDict()
|
||||||
self._post_parse_error = True
|
self._post_parse_error = True
|
||||||
|
|
||||||
def _load_post_and_files(self):
|
def _load_post_and_files(self):
|
||||||
"""Populate self._post and self._files if the content-type is a form type"""
|
"""Populate self._post and self._files if the content-type is a form type"""
|
||||||
if self.method != 'POST':
|
if self.method != 'POST':
|
||||||
self._post, self._files = QueryDict('', encoding=self._encoding), MultiValueDict()
|
self._post, self._files = QueryDict(encoding=self._encoding), MultiValueDict()
|
||||||
return
|
return
|
||||||
if self._read_started and not hasattr(self, '_body'):
|
if self._read_started and not hasattr(self, '_body'):
|
||||||
self._mark_post_parse_error()
|
self._mark_post_parse_error()
|
||||||
|
@ -301,7 +301,7 @@ class HttpRequest(object):
|
||||||
elif self.content_type == 'application/x-www-form-urlencoded':
|
elif self.content_type == 'application/x-www-form-urlencoded':
|
||||||
self._post, self._files = QueryDict(self.body, encoding=self._encoding), MultiValueDict()
|
self._post, self._files = QueryDict(self.body, encoding=self._encoding), MultiValueDict()
|
||||||
else:
|
else:
|
||||||
self._post, self._files = QueryDict('', encoding=self._encoding), MultiValueDict()
|
self._post, self._files = QueryDict(encoding=self._encoding), MultiValueDict()
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
if hasattr(self, '_files'):
|
if hasattr(self, '_files'):
|
||||||
|
@ -473,7 +473,7 @@ class QueryDict(MultiValueDict):
|
||||||
:arg safe: Used to specify characters which do not require quoting, for
|
:arg safe: Used to specify characters which do not require quoting, for
|
||||||
example::
|
example::
|
||||||
|
|
||||||
>>> q = QueryDict('', mutable=True)
|
>>> q = QueryDict(mutable=True)
|
||||||
>>> q['next'] = '/a&b/'
|
>>> q['next'] = '/a&b/'
|
||||||
>>> q.urlencode()
|
>>> q.urlencode()
|
||||||
'next=%2Fa%26b%2F'
|
'next=%2Fa%26b%2F'
|
||||||
|
|
Loading…
Reference in New Issue