Fix for an Issue #401

This commit is contained in:
Miroslav Stampar 2013-02-18 11:38:01 +01:00
parent 6bacbdb031
commit 5c099efccc

View File

@ -1051,7 +1051,7 @@ def checkNullConnection():
try: try:
page, headers, _ = Request.getPage(method=HTTPMETHOD.HEAD) page, headers, _ = Request.getPage(method=HTTPMETHOD.HEAD)
if not page and HTTPHEADER.CONTENT_LENGTH in headers: if not page and HTTPHEADER.CONTENT_LENGTH in (headers or {}):
kb.nullConnection = NULLCONNECTION.HEAD kb.nullConnection = NULLCONNECTION.HEAD
infoMsg = "NULL connection is supported with HEAD header" infoMsg = "NULL connection is supported with HEAD header"
@ -1059,7 +1059,7 @@ def checkNullConnection():
else: else:
page, headers, _ = Request.getPage(auxHeaders={HTTPHEADER.RANGE: "bytes=-1"}) page, headers, _ = Request.getPage(auxHeaders={HTTPHEADER.RANGE: "bytes=-1"})
if page and len(page) == 1 and HTTPHEADER.CONTENT_RANGE in headers: if page and len(page) == 1 and HTTPHEADER.CONTENT_RANGE in (headers or {}):
kb.nullConnection = NULLCONNECTION.RANGE kb.nullConnection = NULLCONNECTION.RANGE
infoMsg = "NULL connection is supported with GET header " infoMsg = "NULL connection is supported with GET header "