make sure the type of input value is int

This commit is contained in:
软件工程师李飛 2019-03-31 05:35:51 +08:00 committed by GitHub
parent 68887af903
commit 2280e040d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,8 +47,8 @@ def apihealth():
def reset(): def reset():
if 'w' in request.args and 'h' in request.args: if 'w' in request.args and 'h' in request.args:
args = { args = {
'w': request.args.get('w'), 'w': int(request.args.get('w')),
'h': request.args.get('h'), 'h': int(request.args.get('h')),
} }
state.set_size(args['w'], args['h']) state.set_size(args['w'], args['h'])