Convert bool-like string arguments to actual bool

This commit is contained in:
Alexandre Aubin 2018-08-31 23:11:57 +00:00
parent f7802d724b
commit b2dd7d97aa

View file

@ -402,6 +402,14 @@ class _ActionsMapPlugin(object):
- arguments -- A dict of arguments for the route - arguments -- A dict of arguments for the route
""" """
# Convert POST arguments to boolean if they look like one...
for k, v in arguments.items():
if v.lower() == "true":
arguments[k] = True
elif v.lower() == "false":
arguments[k] = False
try: try:
ret = self.actionsmap.process(arguments, timeout=30, route=_route) ret = self.actionsmap.process(arguments, timeout=30, route=_route)
except MoulinetteError as e: except MoulinetteError as e: