Fixed form-parsing bug.
authorFredrik Tolf <fredrik@dolda2000.com>
Wed, 7 May 2014 16:13:22 +0000 (18:13 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Wed, 7 May 2014 16:13:22 +0000 (18:13 +0200)
wrw/form.py

index a57a812..53fc82d 100644 (file)
@@ -7,7 +7,7 @@ def formparse(req):
     buf = {}
     buf.update(urllib.parse.parse_qsl(req.query))
     if req.ihead.get("Content-Type") == "application/x-www-form-urlencoded":
-        rbody = req.input(2 ** 20)
+        rbody = req.input.read(2 ** 20)
         if len(rbody) >= 2 ** 20:
             raise ValueError("x-www-form-urlencoded data is absurdly long")
         buf.update(urllib.parse.parse_qsl(rbody.decode("latin1")))