From dbce417cdde95379405a6ee0bbdeebcabe078f21 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 2 Sep 2012 22:48:41 +0200 Subject: [PATCH] Potential fix for an Issue #171 --- lib/request/connect.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/request/connect.py b/lib/request/connect.py index a83e3800a..f9b18b895 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -126,9 +126,9 @@ class Connect: def __connReadProxy(conn): retVal = "" - if not kb.dnsMode: - if conn.headers.getheader(HTTPHEADER.CONTENT_ENCODING, "").lower() in ("gzip", "deflate")\ - or "text" not in conn.headers.getheader(HTTPHEADER.CONTENT_TYPE, "").lower(): + 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()): retVal = conn.read() else: while True: