aboutsummaryrefslogtreecommitdiff
path: root/cgi/framework.py
diff options
context:
space:
mode:
Diffstat (limited to 'cgi/framework.py')
-rw-r--r--cgi/framework.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cgi/framework.py b/cgi/framework.py
index 4a9a6e2..5f4f4f4 100644
--- a/cgi/framework.py
+++ b/cgi/framework.py
@@ -220,13 +220,15 @@ def getFormData(self):
Process input sent to WSGI through a POST method and output it in an easy to
retrieve format: dictionary of dictionaries in the format of {key: value}
"""
+ # This must be done to avoid a bug in cgi.FieldStorage
+ self.environ.setdefault("QUERY_STRING", "")
+ if self.environ["QUERY_STRING"] == "rawpost":
+ return None
wsgi_input = self.environ["wsgi.input"]
post_form = self.environ.get("wsgi.post_form")
if (post_form is not None
and post_form[0] is wsgi_input):
return post_form[2]
- # This must be done to avoid a bug in cgi.FieldStorage
- self.environ.setdefault("QUERY_STRING", "")
fs = cgi.FieldStorage(fp=wsgi_input,
environ=self.environ,
keep_blank_values=1)