diff --git a/lib/request/connect.py b/lib/request/connect.py index 5f5d6727b..87814567d 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -136,8 +136,9 @@ class Connect: retVal = "" if not kb.dnsMode and conn: - if conn.headers and (conn.headers.getheader(HTTPHEADER.CONTENT_ENCODING, "").lower() in ("gzip", "deflate")\ - or "text" not in conn.headers.getheader(HTTPHEADER.CONTENT_TYPE, "").lower()): + headers = conn.info() + if headers and (headers.getheader(HTTPHEADER.CONTENT_ENCODING, "").lower() in ("gzip", "deflate")\ + or "text" not in headers.getheader(HTTPHEADER.CONTENT_TYPE, "").lower()): retVal = conn.read() else: while True: