Fixed form handler bug when no POST data is present.
authorFredrik Tolf <fredrik@dolda2000.com>
Mon, 31 Oct 2011 08:47:09 +0000 (09:47 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Mon, 31 Oct 2011 08:47:09 +0000 (09:47 +0100)
wrw/form.py

index 049da10..af599e6 100644 (file)
@@ -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)