Implemented a better way to deal with % characters in parameters' value. Minor code restyle.

This commit is contained in:
Bernardo Damele
2008-10-16 15:31:02 +00:00
parent d664f0387e
commit a5b2366033
8 changed files with 30 additions and 40 deletions

View File

@@ -87,14 +87,14 @@ class Connect:
get = conf.parameters["GET"]
if get:
get = urlencode(get)
get = urlencode(get).replace("%%", "%")
url = "%s?%s" % (url, get)
requestMsg += "?%s" % get
elif conf.method == "POST":
if conf.parameters.has_key("POST") and not post:
post = conf.parameters["POST"]
post = urlencode(post)
post = urlencode(post).replace("%%", "%")
requestMsg += " HTTP/1.1"
@@ -113,7 +113,7 @@ class Connect:
if not cookieStr:
cookieStr = "Cookie: "
cookie = str(cookie)
cookie = str(cookie).replace("%%", "%")
index = cookie.index(" for ")
cookieStr += "%s; " % cookie[8:index]