After more discussion with Jim, change the behavior so that only a
*missing* content-type at the outer level of a POST defaults to urlencoded. In all other circumstances, the default is read_singe().
This commit is contained in:
parent
122473fc70
commit
60a3bd8130
10
Lib/cgi.py
10
Lib/cgi.py
@ -899,16 +899,8 @@ class FieldStorage:
|
|||||||
self.read_urlencoded()
|
self.read_urlencoded()
|
||||||
elif ctype[:10] == 'multipart/':
|
elif ctype[:10] == 'multipart/':
|
||||||
self.read_multi(environ, keep_blank_values, strict_parsing)
|
self.read_multi(environ, keep_blank_values, strict_parsing)
|
||||||
elif self.outerboundary or method != 'POST':
|
|
||||||
# we're in an inner part, but the content-type wasn't something we
|
|
||||||
# understood. default to read_single() because the resulting
|
|
||||||
# FieldStorage won't be a mapping (and doesn't need to be).
|
|
||||||
self.read_single()
|
|
||||||
else:
|
else:
|
||||||
# we're in an outer part, but the content-type wasn't something we
|
self.read_single()
|
||||||
# understood. we still want the resulting FieldStorage to be a
|
|
||||||
# mapping, so parse it as if it were urlencoded
|
|
||||||
self.read_urlencoded()
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""Return a printable representation."""
|
"""Return a printable representation."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user