From c40dded28c07b85d61b5fc790a25dc8a25a5a44f Mon Sep 17 00:00:00 2001
From: Miroslav Stampar <miroslav.stampar@gmail.com>
Date: Tue, 20 Nov 2012 12:10:29 +0100
Subject: [PATCH] Fix for an Issue #250

---
 lib/request/connect.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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: