Skip to content

Commit e021a21

Browse files
fix bug single host report API
1 parent 9112634 commit e021a21

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

api.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,14 @@ def port_details(request, address, portid):
6969
r['out'] = json.dumps(oo['nmaprun'], indent=4)
7070
o = json.loads(r['out'])
7171

72-
for i in o['host']:
72+
for ik in o['host']:
73+
74+
# this fix single host report
75+
if type(ik) is dict:
76+
i = ik
77+
else:
78+
i = o['host']
79+
7380
if '@addr' in i['address']:
7481
saddress = i['address']['@addr']
7582
elif type(i['address']) is list:

0 commit comments

Comments
 (0)