fix: Failed hip resolutions crash
All checks were successful
Build Docker / Build Image (push) Successful in 21s

This commit is contained in:
Nathan Woodburn 2023-11-09 22:25:58 +11:00
parent e77003125d
commit 24d4ea2afb
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -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)