Skip to content

Commit 12ea082

Browse files
committed
fix:broken endpoint error in acunetix XML parser with unittests
1 parent 7d8b3f9 commit 12ea082

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

dojo/tools/acunetix/parse_acunetix_xml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def get_findings(self, filename, test):
6767
root = parse(filename).getroot()
6868
for scan in root.findall("Scan"):
6969
start_url = scan.findtext("StartURL")
70-
if ":" not in start_url:
70+
if "://" not in start_url:
7171
start_url = "//" + start_url
7272
# get report date
7373
if scan.findtext("StartTime") and scan.findtext("StartTime"):

unittests/scans/acunetix/one_finding_with_port_num.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Scan>
44
<Name>VijayTest</Name>
55
<ShortName>Vijay Short Name</ShortName>
6-
<StartURL>https://vijaytest.com:4000"</StartURL>
6+
<StartURL>https://vijaytest.com</StartURL>
77
<StartTime>24/09/2018, 18:09:55</StartTime>
88
<FinishTime>24/09/2018, 21:42:41</FinishTime>
99
<ScanTime>212 minutes, 4 seconds</ScanTime>

unittests/tools/test_acunetix_parser_port_num.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_parse_file_with_multiple_finding(self):
6969
self.assertIsNotNone(req_resp["req"])
7070
self.assertIsInstance(req_resp["req"], str)
7171
self.assertIn("resp", req_resp)
72-
self.assertIsNotNone(req_resp["resp"])unittests/tools/test_acunetix_parser.py
72+
self.assertIsNotNone(req_resp["resp"])
7373
self.assertIsInstance(req_resp["resp"], str)
7474

7575
with self.subTest(i=1):
@@ -132,7 +132,7 @@ def test_parse_file_with_multiple_finding(self):
132132
self.assertIsInstance(req_resp["resp"], str)
133133

134134
def test_parse_file_with_example_com(self):
135-
with (get_unit_tests_scans_path("acunetix") / "XML_http_example_co_id_port _num.xml").open(encoding="utf-8") as testfile:
135+
with (get_unit_tests_scans_path("acunetix") / "XML_http_example_co_id_port_num.xml").open(encoding="utf-8") as testfile:
136136
parser = AcunetixParser()
137137
findings = parser.get_findings(testfile, Test())
138138
for finding in findings:

0 commit comments

Comments
 (0)