Commit a16b45d8 authored by Jim Fulton's avatar Jim Fulton

Checked in Guido's changes.

parent 6aeffd22
...@@ -841,8 +841,10 @@ class FieldStorage: ...@@ -841,8 +841,10 @@ class FieldStorage:
# but it happens to be something we don't understand. # but it happens to be something we don't understand.
if self.headers.has_key('content-type'): if self.headers.has_key('content-type'):
ctype, pdict = parse_header(self.headers['content-type']) ctype, pdict = parse_header(self.headers['content-type'])
else: elif self.outerboundary or method != 'POST':
ctype, pdict = "text/plain", {} ctype, pdict = "text/plain", {}
else:
ctype, pdict = 'application/x-www-form-urlencoded', {}
self.type = ctype self.type = ctype
self.type_options = pdict self.type_options = pdict
self.innerboundary = "" self.innerboundary = ""
...@@ -865,8 +867,7 @@ class FieldStorage: ...@@ -865,8 +867,7 @@ 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 elif self.outerboundary or method != 'POST':
ctype!= 'application/x-www-form-urlencoded'):
# we're in an inner part, but the content-type wasn't something we # we're in an inner part, but the content-type wasn't something we
# understood. default to read_single() because the resulting # understood. default to read_single() because the resulting
# FieldStorage won't be a mapping (and doesn't need to be). # FieldStorage won't be a mapping (and doesn't need to be).
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment