Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbce417

Browse files
committed
Potential fix for an Issue #171
1 parent f6716cf commit dbce417

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/request/connect.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ def __retryProxy(**kwargs):
126126
def __connReadProxy(conn):
127127
retVal = ""
128128

129-
if not kb.dnsMode:
130-
if conn.headers.getheader(HTTPHEADER.CONTENT_ENCODING, "").lower() in ("gzip", "deflate")\
131-
or "text" not in conn.headers.getheader(HTTPHEADER.CONTENT_TYPE, "").lower():
129+
if not kb.dnsMode and conn:
130+
if conn.headers and (conn.headers.getheader(HTTPHEADER.CONTENT_ENCODING, "").lower() in ("gzip", "deflate")\
131+
or "text" not in conn.headers.getheader(HTTPHEADER.CONTENT_TYPE, "").lower()):
132132
retVal = conn.read()
133133
else:
134134
while True:

0 commit comments

Comments
 (0)