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

Skip to content

Commit 788eb8f

Browse files
committed
update regarding Bug #205
1 parent 762c2a1 commit 788eb8f

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

lib/request/connect.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,6 @@ def getPage(**kwargs):
138138
else:
139139
req = urllib2.Request(url, post, headers)
140140

141-
if not req.has_header("Accept-Encoding"):
142-
requestHeaders += "Accept-Encoding: identity\n"
143-
144-
requestHeaders += "\n".join(["%s: %s" % (header, value) for header, value in req.header_items()])
145-
146141
if not conf.dropSetCookie and conf.cj:
147142
for _, cookie in enumerate(conf.cj):
148143
if not cookieStr:
@@ -153,12 +148,10 @@ def getPage(**kwargs):
153148

154149
cookieStr += "%s; " % cookie[8:index]
155150

156-
if not req.has_header("Cookie") and cookieStr:
157-
requestHeaders += "\n%s" % cookieStr[:-2]
158-
159-
if not req.has_header("Connection"):
160-
requestHeaders += "\nConnection: close"
161-
151+
conn = urllib2.urlopen(req)
152+
153+
requestHeaders += "\n".join(["%s: %s" % (header, value) for header, value in req.header_items()])
154+
162155
requestMsg += "\n%s" % requestHeaders
163156

164157
if post:
@@ -168,8 +161,6 @@ def getPage(**kwargs):
168161

169162
logger.log(9, requestMsg)
170163

171-
conn = urllib2.urlopen(req)
172-
173164
if not kb.authHeader and req.has_header("Authorization"):
174165
kb.authHeader = req.get_header("Authorization")
175166

0 commit comments

Comments
 (0)