Patch related to #4527 (drei)

This commit is contained in:
Miroslav Stampar
2021-01-06 16:09:40 +01:00
parent 779b352f6b
commit f84ec1072b
3 changed files with 3 additions and 3 deletions

View File

@@ -303,7 +303,7 @@ def decodePage(page, contentEncoding, contentType, percentDecode=True):
page = data.read()
except Exception as ex:
if "<html" not in page: # in some cases, invalid "Content-Encoding" appears for plain HTML (should be ignored)
if b"<html" not in page: # in some cases, invalid "Content-Encoding" appears for plain HTML (should be ignored)
errMsg = "detected invalid data for declared content "
errMsg += "encoding '%s' ('%s')" % (contentEncoding, getSafeExString(ex))
singleTimeLogMessage(errMsg, logging.ERROR)