diff --git a/flaskapp/app.py b/flaskapp/app.py index 19846b0..9e01226 100644 --- a/flaskapp/app.py +++ b/flaskapp/app.py @@ -43,7 +43,7 @@ class ProtectedView(Resource): assert(realm == config('REALM_ALLOWED')) code = check_otp(user, realm, token) assert(code == 200) - except KeyError or AssertionError: + except (KeyError, AssertionError) as e: response = app.response_class(response=json.dumps({'Message': 'Invalid data'}), status=400, mimetype='application/json') @@ -63,4 +63,4 @@ api.add_resource(MainView, '/') api.add_resource(ProtectedView, '/protected') if __name__ == '__main__': - app.run() + app.run(host='::')