Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #149 from ericlaw1979/master
Browse files Browse the repository at this point in the history
Correct load_domains behavior for skipping rows
  • Loading branch information
konklone committed Oct 30, 2017
2 parents 9afd98b + 68270d8 commit ca1e48b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scanners/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,16 @@ def load_domains(domain_csv, whole_rows=False):
domains = []
with open(domain_csv, newline='') as csvfile:
for row in csv.reader(csvfile):
if (not row[0]) or (row[0].lower().startswith("domain")):
# Skip empty rows.
if (not row) or (not row[0].strip()):
continue

row[0] = row[0].lower()

# Skip any header row.
if (not domains) and (row[0].startswith("domain")):
continue

if whole_rows:
domains.append(row)
else:
Expand Down

0 comments on commit ca1e48b

Please sign in to comment.