diff options
-rwxr-xr-x | src/wsgi.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/wsgi.py b/src/wsgi.py index 1eda9de..aed3513 100755 --- a/src/wsgi.py +++ b/src/wsgi.py @@ -75,7 +75,7 @@ class EPAdd(CollectorResource): return try: - keys = json.loads(decodedin, object_hook=self.handle_data) + json_data = json.loads(decodedin) except TypeError: print('DEBUG: type error') resp.status = falcon.HTTP_400 @@ -87,12 +87,8 @@ class EPAdd(CollectorResource): resp.text = CollectorResource.parse_error(decodedin) return - resp.text = '' - for key in keys: - resp.text += repr(key) + '\n' - - def handle_data(self, data): - return self._db.add(data) # return key + key = self._db.add(json_data) + resp.text = repr(key) + '\n' def init(url_res_map, addr = '', port = 8000): |