def formparse(req):
buf = {}
- buf.update(urllib.parse.parse_qsl(req.query))
+ buf.update(urlparse.parse_qsl(req.query))
if req.ihead.get("Content-Type") == "application/x-www-form-urlencoded":
- if req.input.limit > 2 ** 20:
+ rbody = req.input(2 ** 20)
+ if len(rbody) >= 2 ** 20:
raise ValueError("x-www-form-urlencoded data is absurdly long")
- rbody = req.input.read()
- buf.update(urllib.parse.parse_qsl(rbody.decode("latin1")))
+ buf.update(urlparse.parse_qsl(rbody))
return buf
class badmultipart(Exception):