Commit fafd25bd authored by Romain Courteaud's avatar Romain Courteaud

status: report domain not handled in case of http redirection

parent a0412e9a
...@@ -533,9 +533,25 @@ class WebBot: ...@@ -533,9 +533,25 @@ class WebBot:
# Get the list of HTTP servers to check # Get the list of HTTP servers to check
result_dict["http_query"] = [] result_dict["http_query"] = []
missing_url_list = []
for ip, url_list in ip_to_url_dict.items(): for ip, url_list in ip_to_url_dict.items():
query = reportHttp(self._db, ip=ip, url=url_list) query = reportHttp(self._db, ip=ip, url=url_list)
for network_change in query.dicts().iterator(): for network_change in query.dicts().iterator():
if network_change["status_code"] in (301, 302, 303):
redirect_url = getRootUrl(
network_change["http_header_dict"]["Location"]
)
if (redirect_url not in url_dict) and (
redirect_url not in missing_url_list
):
missing_url_list.append(redirect_url)
result_dict["missing_data"].append(
{
"text": "(%s ->) %s"
% (network_change["url"], redirect_url),
"date": result_dict["bot_status"][0]["date"],
}
)
result_dict["http_query"].append( result_dict["http_query"].append(
{ {
"status_code": network_change["status_code"], "status_code": network_change["status_code"],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment