From aba06d860c73dbf873fd4a282d72f442bfd13b18 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Mon, 31 Oct 2011 09:47:09 +0100 Subject: [PATCH] Fixed form handler bug when no POST data is present. --- wrw/form.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrw/form.py b/wrw/form.py index 049da10..af599e6 100644 --- a/wrw/form.py +++ b/wrw/form.py @@ -4,7 +4,7 @@ __all__ = ["formdata"] class formwrap(object): def __init__(self, req): - if req.ihead["Content-Type"] == "application/x-www-form-urlencoded": + if req.ihead.get("Content-Type") == "application/x-www-form-urlencoded": self.cf = cgi.parse(environ = req.env, fp = req.env["wsgi.input"]) else: self.cf = cgi.parse(environ = req.env) -- 2.11.0