This is an automated email from the ASF dual-hosted git repository.
humbedooh 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 7c6ac4b Refactor, use request.query which is already parsed properly
7c6ac4b is described below
commit 7c6ac4b82b6b63262b62b86defb1118b736835ef
Author: Daniel Gruno <[email protected]>
AuthorDate: Mon Nov 29 19:15:55 2021 +0100
Refactor, use request.query which is already parsed properly
This addresses #165
---
server/plugins/formdata.py | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/server/plugins/formdata.py b/server/plugins/formdata.py
index d22e0f2..67ede3c 100644
--- a/server/plugins/formdata.py
+++ b/server/plugins/formdata.py
@@ -32,11 +32,8 @@ ERRONEOUS_PAYLOAD = "Erroneous payload received"
async def parse_formdata(body_type, request: aiohttp.web.BaseRequest) -> dict:
indata = {}
# Do we have query string arguments?
- if "?" in request.path_qs:
- query_string = request.path_qs.split("?", 1)[1]
- # Some args have no values, e.g. quick, emailsOnly
- for key, val in urllib.parse.parse_qsl(query_string,
keep_blank_values=True):
- indata[key] = val
+ for key, val in request.query.items():
+ indata[key] = val
# PUT/POST form data?
if request.method in ["PUT", "POST"]:
if request.can_read_body: