Skip to content

Commit

Permalink
BREAKING update falcon to 2.0
Browse files Browse the repository at this point in the history
fixed falcon hook pos arg
fixed keep blank kwarg
call to req.stream.read updated to recommended
  • Loading branch information
Nateyo committed Jan 20, 2020
1 parent 140dd7d commit b57ab1a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ Contributors (chronological)
* Martin Roy <https://github.com/lindycoder>
* Kubilay Kocak <https://github.com/koobs>
* Stephen Rosen <https://github.com/sirosen>
* @dodumosu <https://github.com/dodumosu>
* Nate Dellinger <https://github.com/Nateyo>
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"tornado>=4.5.2",
"pyramid>=1.9.1",
"webapp2>=3.0.0b1",
"falcon>=1.4.0,<2.0",
"falcon>=2.0.0",
"aiohttp>=3.0.0",
]
EXTRAS_REQUIRE = {
Expand Down
6 changes: 2 additions & 4 deletions src/webargs/falconparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def parse_form_body(req):
req.content_type is not None
and "application/x-www-form-urlencoded" in req.content_type
):
body = req.stream.read()
body = req.stream.read(req.content_length or 0)
try:
body = body.decode("ascii")
except UnicodeDecodeError:
Expand All @@ -48,9 +48,7 @@ def parse_form_body(req):
)

if body:
return parse_query_string(
body, keep_blank_qs_values=req.options.keep_blank_qs_values
)
return parse_query_string(body, keep_blank=req.options.keep_blank_qs_values)

return core.missing

Expand Down
2 changes: 1 addition & 1 deletion tests/apps/falcon_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def on_post(self, req, resp):


def use_args_hook(args, context_key="args", **kwargs):
def hook(req, resp, params):
def hook(req, resp, resource, params):
parsed_args = parser.parse(args, req=req, **kwargs)
req.context[context_key] = parsed_args

Expand Down

0 comments on commit b57ab1a

Please sign in to comment.