Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60a3bd8

Browse files
committed
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().
1 parent 122473f commit 60a3bd8

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

Lib/cgi.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -899,16 +899,8 @@ def __init__(self, fp=None, headers=None, outerboundary="",
899899
self.read_urlencoded()
900900
elif ctype[:10] == 'multipart/':
901901
self.read_multi(environ, keep_blank_values, strict_parsing)
902-
elif self.outerboundary or method != 'POST':
903-
# we're in an inner part, but the content-type wasn't something we
904-
# understood. default to read_single() because the resulting
905-
# FieldStorage won't be a mapping (and doesn't need to be).
906-
self.read_single()
907902
else:
908-
# we're in an outer part, but the content-type wasn't something we
909-
# understood. we still want the resulting FieldStorage to be a
910-
# mapping, so parse it as if it were urlencoded
911-
self.read_urlencoded()
903+
self.read_single()
912904

913905
def __repr__(self):
914906
"""Return a printable representation."""

0 commit comments

Comments
 (0)