Fix logic bug in param check
This commit is contained in:
parent
679044574a
commit
5f2729f41f
1 changed files with 1 additions and 1 deletions
|
@ -94,7 +94,7 @@ def param_required(param_name, allow_body=False):
|
||||||
@wraps(wrapped)
|
@wraps(wrapped)
|
||||||
def decorated(*args, **kwargs):
|
def decorated(*args, **kwargs):
|
||||||
if param_name not in request.args:
|
if param_name not in request.args:
|
||||||
if not allow_body and param_name not in request.values:
|
if not allow_body or param_name not in request.values:
|
||||||
abort(make_response('Required param: %s' % param_name, 400))
|
abort(make_response('Required param: %s' % param_name, 400))
|
||||||
return wrapped(*args, **kwargs)
|
return wrapped(*args, **kwargs)
|
||||||
return decorated
|
return decorated
|
||||||
|
|
Reference in a new issue