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

Skip to content

Commit 27707be

Browse files
committed
Fixes #1416
1 parent aa2112b commit 27707be

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/request/connect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,9 +1053,9 @@ def _randomizeParameter(paramString, randomParameter):
10531053
_, headers, code = Connect.getPage(url=uri, get=get, post=post, method=method, cookie=cookie, ua=ua, referer=referer, host=host, silent=silent, auxHeaders=auxHeaders, raise404=raise404, skipRead=(kb.nullConnection == NULLCONNECTION.SKIP_READ))
10541054

10551055
if headers:
1056-
if kb.nullConnection in (NULLCONNECTION.HEAD, NULLCONNECTION.SKIP_READ) and HTTP_HEADER.CONTENT_LENGTH in headers:
1056+
if kb.nullConnection in (NULLCONNECTION.HEAD, NULLCONNECTION.SKIP_READ) and headers.get(HTTP_HEADER.CONTENT_LENGTH):
10571057
pageLength = int(headers[HTTP_HEADER.CONTENT_LENGTH])
1058-
elif kb.nullConnection == NULLCONNECTION.RANGE and HTTP_HEADER.CONTENT_RANGE in headers:
1058+
elif kb.nullConnection == NULLCONNECTION.RANGE and headers.get(HTTP_HEADER.CONTENT_RANGE):
10591059
pageLength = int(headers[HTTP_HEADER.CONTENT_RANGE][headers[HTTP_HEADER.CONTENT_RANGE].find('/') + 1:])
10601060
finally:
10611061
kb.pageCompress = popValue()

0 commit comments

Comments
 (0)