Potential fix for an Issue #171

This commit is contained in:
Miroslav Stampar 2012-09-02 22:48:41 +02:00
parent f6716cf7c0
commit dbce417cdd

View File

@ -126,9 +126,9 @@ class Connect:
def __connReadProxy(conn): def __connReadProxy(conn):
retVal = "" retVal = ""
if not kb.dnsMode: if not kb.dnsMode and conn:
if conn.headers.getheader(HTTPHEADER.CONTENT_ENCODING, "").lower() in ("gzip", "deflate")\ 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(): or "text" not in conn.headers.getheader(HTTPHEADER.CONTENT_TYPE, "").lower()):
retVal = conn.read() retVal = conn.read()
else: else:
while True: while True: