From: Fredrik Tolf Date: Sun, 12 Feb 2023 14:41:51 +0000 (+0100) Subject: Keep blank values in formdata. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=cbb2bf5852924803bdb13779dc0e8e88000925d6;p=wrw.git Keep blank values in formdata. --- diff --git a/wrw/form.py b/wrw/form.py index d39d4dd..f821ea1 100644 --- a/wrw/form.py +++ b/wrw/form.py @@ -5,7 +5,7 @@ __all__ = ["formdata"] def formparse(req): buf = {} - buf.update(urllib.parse.parse_qsl(req.query)) + buf.update(urllib.parse.parse_qsl(req.query, keep_blank_values=True)) if req.ihead.get("Content-Type") == "application/x-www-form-urlencoded": try: rbody = req.input.read(2 ** 20) @@ -13,7 +13,7 @@ def formparse(req): return exc if len(rbody) >= 2 ** 20: return ValueError("x-www-form-urlencoded data is absurdly long") - buf.update(urllib.parse.parse_qsl(rbody.decode("latin1"))) + buf.update(urllib.parse.parse_qsl(rbody.decode("latin1"), keep_blank_values=True)) return buf class badmultipart(IOError):