From 76338add1700b95eb8ebd4ef907d0dceb5935700 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 20 Aug 2012 10:41:43 +0200 Subject: [PATCH] Fix for an Issue #152 --- lib/controller/checks.py | 3 +++ lib/request/connect.py | 2 +- thirdparty/keepalive/keepalive.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/controller/checks.py b/lib/controller/checks.py index 8ed1e296e..54188a6eb 100644 --- a/lib/controller/checks.py +++ b/lib/controller/checks.py @@ -953,6 +953,9 @@ def checkNullConnection(): Reference: http://www.wisec.it/sectou.php?id=472f952d79293 """ + if conf.data: + return False + infoMsg = "testing NULL connection to the target url" logger.info(infoMsg) diff --git a/lib/request/connect.py b/lib/request/connect.py index c5175d9b8..607e650cf 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -242,7 +242,7 @@ class Connect: return page - elif any ((refreshing, crawling)): + elif any((refreshing, crawling)): pass elif target: diff --git a/thirdparty/keepalive/keepalive.py b/thirdparty/keepalive/keepalive.py index 6d35597e0..674391f9a 100644 --- a/thirdparty/keepalive/keepalive.py +++ b/thirdparty/keepalive/keepalive.py @@ -129,7 +129,7 @@ class HTTPHandler(urllib2.HTTPHandler): if not req.headers.has_key('Content-length'): req.headers['Content-length'] = '%d' % len(data) else: - h.putrequest('GET', req.get_selector()) + h.putrequest(req.get_method() or 'GET', req.get_selector()) if not req.headers.has_key('Connection'): req.headers['Connection'] = 'keep-alive'