Merge pull request #676 from JeLuF/ipfix

Return empty list if hostname lookup fails
This commit is contained in:
cmdr2 2022-12-19 09:14:40 +05:30 committed by GitHub
commit 1a5e15608c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,9 +314,15 @@ def getUIPlugins():
return plugins return plugins
def getIPConfig(): def getIPConfig():
ips = socket.gethostbyname_ex(socket.gethostname()) try:
ips[2].append(ips[0]) ips = socket.gethostbyname_ex(socket.gethostname())
return ips[2] ips[2].append(ips[0])
return ips[2]
except Exception as e:
print(e)
print(traceback.format_exc())
return []
@app.get('/get/{key:path}') @app.get('/get/{key:path}')
def read_web_data(key:str=None): def read_web_data(key:str=None):