From c663fab788aaa8f437464fcf4447fddc5aecb38d Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Wed, 4 Dec 2019 13:27:06 +0100 Subject: [PATCH] Return non found if the locator does not fit the proper format --- pisa/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pisa/api.py b/pisa/api.py index 131ce43..88cccf8 100644 --- a/pisa/api.py +++ b/pisa/api.py @@ -77,6 +77,9 @@ def get_appointment(): response = [] # ToDo: #15-add-system-monitor + if not isinstance(locator, str) or len(locator) != 64: + response.append({"locator": locator, "status": "not_found"}) + return jsonify(response) locator_map = watcher.db_manager.load_locator_map(locator)