You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2021/10/10 22:02:08 UTC

[incubator-ponymail-foal] branch master updated: URL parser discards args with no values

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new 9370e0a  URL parser discards args with no values
9370e0a is described below

commit 9370e0a4d86afa5911b4b823c354f6b45329fac3
Author: Sebb <se...@apache.org>
AuthorDate: Sun Oct 10 23:01:57 2021 +0100

    URL parser discards args with no values
    
    This fixes #117
---
 server/plugins/formdata.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/plugins/formdata.py b/server/plugins/formdata.py
index 73b5434..94c0f90 100644
--- a/server/plugins/formdata.py
+++ b/server/plugins/formdata.py
@@ -31,7 +31,8 @@ ERRONEOUS_PAYLOAD = "Erroneous payload received"
 
 async def parse_formdata(body_type, request: aiohttp.web.BaseRequest) -> dict:
     indata = {}
-    for key, val in urllib.parse.parse_qsl(request.query_string):
+    # Some args have no values, e.g. quick, emailsOnly
+    for key, val in urllib.parse.parse_qsl(request.query_string, keep_blank_values = True):
         indata[key] = val
     # PUT/POST form data?
     if request.method in ["PUT", "POST"]: