From 36953221f82c526fa426893f8c9a5c41d246131b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 10 Jun 2010 11:34:17 +0000 Subject: [PATCH] few quick changes --- lib/request/basic.py | 4 ++-- lib/request/connect.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/request/basic.py b/lib/request/basic.py index 07dd6f075..8072a35da 100644 --- a/lib/request/basic.py +++ b/lib/request/basic.py @@ -87,7 +87,7 @@ def parseResponse(page, headers): if absFilePath not in kb.absFilePaths: kb.absFilePaths.add(absFilePath) - + def decodePage(page, contentEncoding, contentType): """ @@ -105,6 +105,6 @@ def decodePage(page, contentEncoding, contentType): #http://stackoverflow.com/questions/1020892/python-urllib2-read-to-unicode if contentType and (contentType.find('charset=') != -1): - page = unicode(page, contentType.split('charset=')[-1]) + page = unicode(page, contentType.split('charset=')[-1]) #don't use getUnicode here. it needs to stay as is. return page diff --git a/lib/request/connect.py b/lib/request/connect.py index 227ad6dc7..fd9185cc8 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -32,6 +32,7 @@ import traceback from lib.contrib import multipartpost from lib.core.common import readInput +from lib.core.common import getUnicode from lib.core.convert import urlencode from lib.core.data import conf from lib.core.data import kb @@ -163,7 +164,7 @@ class Connect: if not cookieStr: cookieStr = "Cookie: " - cookie = unicode(cookie) + cookie = getUnicode(cookie) index = cookie.index(" for ") cookieStr += "%s; " % cookie[8:index] @@ -256,7 +257,7 @@ class Connect: responseMsg += "(%s - %d):\n" % (status, code) if conf.verbose <= 4: - responseMsg += unicode(responseHeaders) + responseMsg += getUnicode(responseHeaders) elif conf.verbose > 4: responseMsg += "%s\n%s\n" % (responseHeaders, page)