From 24d4ea2afb52a858bde48d4b9715becabaec4819 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Thu, 9 Nov 2023 22:25:58 +1100 Subject: [PATCH] fix: Failed hip resolutions crash --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 5f8e578..8dc9961 100644 --- a/main.py +++ b/main.py @@ -68,7 +68,11 @@ def lookup(path): token = "HNS" if 'token' in request.args: token = request.args['token'].upper() - return make_response(hip02.resolve(HSD_IP, HSD_PORT, path,token), 200, {'Content-Type': 'text/plain'}) + + hip2 = hip02.resolve(HSD_IP, HSD_PORT, path,token) + if not hip2: + return make_response("", 200, {'Content-Type': 'text/plain'}) + return make_response(hip2, 200, {'Content-Type': 'text/plain'}) # 404 catch all @app.errorhandler(404)