Skip to content

Commit

Permalink
Handling missing case of 3 different lengths in results
Browse files Browse the repository at this point in the history
  • Loading branch information
p0dalirius committed Oct 10, 2021
1 parent b468b07 commit 797633d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ipsourcebypass.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ def print_results(console, results):
elif result[1]["length"] == max(lengths)[1]:
style = "red"
table.add_row(str(result[1]["length"]), str(result[1]["status_code"]), result[1]["header"], style=style)
elif len(lengths) <= 4:
elif len(lengths) == 3:
scale = ["red", "orange3", "green"]
colors = {str(sorted(lengths, reverse=True)[k][1]):scale[k] for k in range(len(lengths))}
for result in results.items():
style = colors[str(result[1]["length"])]
table.add_row(str(result[1]["length"]), str(result[1]["status_code"]), result[1]["header"], style=style)
elif len(lengths) == 4:
scale = ["red", "orange3", "yellow3", "green"]
colors = {str(sorted(lengths, reverse=True)[k][1]):scale[k] for k in range(len(lengths))}
for result in results.items():
Expand Down

0 comments on commit 797633d

Please sign in to comment.