Skip to content

Commit bf170a1

Browse files
author
Brent Cook
committed
the API sometimes returns negative percents - treat these as 0
1 parent 5a27738 commit bf170a1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/auxiliary/gather/ssllabs_scan.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ def output_testing_details(r)
714714
return unless r.status == "IN_PROGRESS"
715715

716716
if r.endpoints.length == 1
717-
print_status "#{r.host} (#{r.endpoints[0].ip_address}) - Progress #{r.endpoints[0].progress}% (#{r.endpoints[0].status_details_message})"
717+
print_status "#{r.host} (#{r.endpoints[0].ip_address}) - Progress #{[r.endpoints[0].progress, 0].max}% (#{r.endpoints[0].status_details_message})"
718718
elsif r.endpoints.length > 1
719719
in_progress_srv_num = 0
720720
ready_srv_num = 0
@@ -723,7 +723,7 @@ def output_testing_details(r)
723723
case e.status_message.to_s
724724
when "In progress"
725725
in_progress_srv_num += 1
726-
print_status "Scanned host: #{e.ip_address} (#{e.server_name})- #{e.progress}% complete (#{e.status_details_message})"
726+
print_status "Scanned host: #{e.ip_address} (#{e.server_name})- #{[e.progress, 0].max}% complete (#{e.status_details_message})"
727727
when "Pending"
728728
pending_srv_num += 1
729729
when "Ready"

0 commit comments

Comments
 (0)