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