From 09e7f4f697835d84ab83661cb3784f5facd643fe Mon Sep 17 00:00:00 2001 From: stamparm Date: Tue, 30 Apr 2013 17:46:26 +0200 Subject: [PATCH] Minor bug fix regarding traffic logging of redirected requests --- lib/request/connect.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/request/connect.py b/lib/request/connect.py index 308193523..4ab8f03e6 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -226,6 +226,7 @@ class Connect(object): # url splitted with space char while urlencoding it in the later phase url = url.replace(" ", "%20") + conn = None code = None page = None @@ -554,7 +555,12 @@ class Connect(object): processResponse(page, responseHeaders) - responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, status) + if conn and hasattr(conn, "redcode"): + responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, conn.code, status) + requestMsg = requestMsg.replace("%s HTTP/" % url, "%s HTTP/" % conn.redurl, 1) + else: + responseMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, status) + if responseHeaders: logHeaders = "\n".join("%s: %s" % (getUnicode(key.capitalize() if isinstance(key, basestring) else key), getUnicode(value)) for (key, value) in responseHeaders.items())