Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rename incorrect keyword argument to parse_query_string #449

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ Contributors (chronological)
* Xiaoyu Lee <https://github.com/lee3164>
* Jonathan Angelo <https://github.com/jangelo>
* @zhenhua32 <https://github.com/zhenhua32>
* @dodumosu <https://github.com/dodumosu>
14 changes: 11 additions & 3 deletions src/webargs/falconparser.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
"""Falcon request argument parsing module.
"""
from distutils.version import LooseVersion

import falcon
from falcon.util.uri import parse_query_string

Expand All @@ -13,6 +15,9 @@
status_map = {422: HTTP_422}


FALCON_VERSION_INFO = tuple(LooseVersion(falcon.__version__).version)


dodumosu marked this conversation as resolved.
Show resolved Hide resolved
# Collect all exceptions from falcon.status_codes
def _find_exceptions():
for name in filter(lambda n: n.startswith("HTTP"), dir(falcon.status_codes)):
Expand Down Expand Up @@ -66,9 +71,12 @@ def parse_form_body(req):
)

if body:
return parse_query_string(
body, keep_blank_qs_values=req.options.keep_blank_qs_values
)
if FALCON_VERSION_INFO[0] < 2:
key = "keep_blank_qs_values"
else:
key = "keep_blank"
kwargs = {key: req.options.keep_blank_qs_values}
return parse_query_string(body, **kwargs)
return {}
dodumosu marked this conversation as resolved.
Show resolved Hide resolved


Expand Down