Skip to content

Commit

Permalink
Merge pull request #1447 from Frky/patch-4
Browse files Browse the repository at this point in the history
Fix bug when 'path' is not in the 'request' dictionary of the json file
  • Loading branch information
p-l- committed Oct 21, 2022
2 parents 3ff365c + 4129b4d commit af12f72
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ivre/zgrabout.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def zgrap_parser_http(
if port is None:
port = guessed_port
# Specific paths
if url.get("path").endswith("/.git/index"):
if url.get("path", "").endswith("/.git/index"):
if resp.get("status_code") != 200:
return {}
if not resp.get("body", "").startswith("DIRC"):
Expand All @@ -170,7 +170,7 @@ def zgrap_parser_http(
}
)
return res
if url.get("path").endswith("/owa/auth/logon.aspx"):
if url.get("path", "").endswith("/owa/auth/logon.aspx"):
if resp.get("status_code") != 200:
return {}
version_set = set(
Expand Down Expand Up @@ -218,7 +218,7 @@ def zgrap_parser_http(
}
)
return res
if url.get("path").endswith("/centreon/"):
if url.get("path", "").endswith("/centreon/"):
if resp.get("status_code") != 200:
return {}
if not resp.get("body"):
Expand Down Expand Up @@ -254,7 +254,7 @@ def zgrap_parser_http(
}
)
return res
if url.get("path").endswith("/.well-known/security.txt"):
if url.get("path", "").endswith("/.well-known/security.txt"):
if resp.get("status_code") != 200:
return {}
if not resp.get("headers"):
Expand Down Expand Up @@ -288,7 +288,7 @@ def zgrap_parser_http(
}
)
return res
if url.get("path") != "/":
if url.get("path", "") != "/":
utils.LOGGER.warning("URL path not supported yet: %s", url.get("path"))
return {}
elif port is None:
Expand Down

0 comments on commit af12f72

Please sign in to comment.