Skip to content

Commit

Permalink
Keep blank values while parsing POST data.
Browse files Browse the repository at this point in the history
JSON-RPC and similar protocols send the json data within the key and
leave the value of the "form" empty. So we need to keep form fields with
empty values to be able to access the rpc data.

Signed-off-by: Bernd Zeimetz <bernd@bzed.de>
  • Loading branch information
bzed authored and defnull committed Apr 5, 2010
1 parent dd4fc5b commit b178eb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bottle.py
Expand Up @@ -693,7 +693,7 @@ def POST(self):
fb = TextIOWrapper(self.body, encoding='ISO-8859-1')
else:
fb = self.body
data = cgi.FieldStorage(fp=fb, environ=save_env)
data = cgi.FieldStorage(fp=fb, environ=save_env, keep_blank_values=True)
self._POST = MultiDict()
for item in data.list:
self._POST[item.name] = item if item.filename else item.value
Expand Down

0 comments on commit b178eb8

Please sign in to comment.