Commit 4c93910e authored by Romain Courteaud's avatar Romain Courteaud

Only warn about no content-type if there is a response body

parent bb3d5e5c
......@@ -720,13 +720,21 @@ class WebBot:
"Content-Type"
not in network_change["http_header_dict"]
):
result_dict["warning"].append(
{
"text": "(No Content-Type header) %s"
% (network_change["url"],),
"date": result_dict["bot_status"][0]["date"],
}
)
if (
network_change["http_header_dict"].get(
"Content-Length", 0
)
!= 0
):
result_dict["warning"].append(
{
"text": "(No Content-Type header) %s"
% (network_change["url"],),
"date": result_dict["bot_status"][0][
"date"
],
}
)
elif network_change["http_header_dict"][
"Content-Type"
].startswith("text/html"):
......
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