File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 33import logging
44import logging .config
55import sys
6- from urllib .parse import parse_qsl
6+ from urllib .parse import parse_qsl as _parse_query_string
77
88from cookies_samesite_compat import CookiesSameSiteCompatMiddleware
99
1818logger = logging .getLogger (__name__ )
1919
2020
21+ def parse_query_string (data ):
22+ query_param_pairs = _parse_query_string (data )
23+ query_param_dict = dict (query_param_pairs )
24+ return query_param_dict
25+
26+
2127def unpack_get (environ ):
2228 """
2329 Unpacks a redirect request query string.
2430 :param environ: whiskey application environment.
2531 :return: A dictionary with parameters.
2632 """
27- if "QUERY_STRING" in environ :
28- return dict (parse_qsl (environ ["QUERY_STRING" ]))
29-
30- return None
33+ return parse_query_string (environ .get ("QUERY_STRING" ))
3134
3235
3336def unpack_post (environ , content_length ):
@@ -39,7 +42,7 @@ def unpack_post(environ, content_length):
3942 post_body = environ ['wsgi.input' ].read (content_length ).decode ("utf-8" )
4043 data = None
4144 if "application/x-www-form-urlencoded" in environ ["CONTENT_TYPE" ]:
42- data = dict ( parse_qsl ( post_body ) )
45+ data = parse_query_string ( post_body )
4346 elif "application/json" in environ ["CONTENT_TYPE" ]:
4447 data = json .loads (post_body )
4548
You can’t perform that action at this time.
0 commit comments