Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
7h3Rabbit committed Feb 5, 2024
1 parent 35f1fd4 commit 15dcdad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/software.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,10 @@ def lookup_response_content(item, response_mimetype, response_content, rules):
if 'contents' not in rules:
return

req_url = item['url'].lower()
o = urlparse(req_url)
hostname = o.hostname

is_found = False
for rule in rules['contents']:
if 'use' not in rule:
Expand All @@ -1118,10 +1122,6 @@ def lookup_response_content(item, response_mimetype, response_content, rules):
if rule['type'] not in response_mimetype:
continue

req_url = item['url'].lower()

o = urlparse(req_url)
hostname = o.hostname

regex = r"{0}".format(rule['match'])
matches = re.finditer(regex, response_content, re.IGNORECASE)
Expand Down

0 comments on commit 15dcdad

Please sign in to comment.