From b178eb8a56a5d100f6f6786f1dddb8d4952abb4d Mon Sep 17 00:00:00 2001 From: Bernd Zeimetz Date: Mon, 5 Apr 2010 14:07:30 +0200 Subject: Keep blank values while parsing POST data. 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 --- bottle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bottle.py b/bottle.py index 554e804..e422052 100755 --- a/bottle.py +++ b/bottle.py @@ -693,7 +693,7 @@ class Request(threading.local, DictMixin): 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 -- cgit v1.2.1