Fix for an Issue #399

This commit is contained in:
Miroslav Stampar 2013-02-15 10:04:13 +01:00
parent 5d068896a9
commit 11bcf28d86

View File

@ -90,13 +90,13 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler):
redirectMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, getUnicode(msg)) redirectMsg += "[#%d] (%d %s):\n" % (threadData.lastRequestUID, code, getUnicode(msg))
if headers: if headers:
logHeaders = "\n".join("%s: %s" % (key.capitalize() if isinstance(key, basestring) else key, getUnicode(value)) for (key, value) in headers.items()) logHeaders = "\n".join("%s: %s" % (getUnicode(key.capitalize() if isinstance(key, basestring) else key), getUnicode(value)) for (key, value) in headers.items())
else: else:
logHeaders = "" logHeaders = ""
redirectMsg += logHeaders redirectMsg += logHeaders
if content: if content:
redirectMsg += "\n\n%s" % content[:MAX_CONNECTION_CHUNK_SIZE] redirectMsg += "\n\n%s" % getUnicode(content[:MAX_CONNECTION_CHUNK_SIZE])
logHTTPTraffic(threadData.lastRequestMsg, redirectMsg) logHTTPTraffic(threadData.lastRequestMsg, redirectMsg)
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, redirectMsg) logger.log(CUSTOM_LOGGING.TRAFFIC_IN, redirectMsg)