Implementation for Issue #108

This commit is contained in:
Miroslav Stampar 2012-07-20 09:48:09 +02:00
parent 53cb105f50
commit f336afa913

View File

@ -653,10 +653,20 @@ class Connect:
get += "%s%s=%s" % (delimiter, name, value) get += "%s%s=%s" % (delimiter, name, value)
get = urlencode(get, limit=True) get = urlencode(get, limit=True)
if post and place not in (PLACE.POST, PLACE.SOAP, PLACE.CUSTOM_POST) and hasattr(post, UNENCODED_ORIGINAL_VALUE): if post:
post = getattr(post, UNENCODED_ORIGINAL_VALUE) if conf.skipUrlEncode is None:
elif not conf.skipUrlEncode and place not in (PLACE.SOAP,): _ = (post or "").strip()
post = urlencode(post) if _.startswith("<") and _.endswith(">"):
msg = "provided POST data looks "
msg += "like it's in XML format. "
msg += "Do you want to turn off URL encoding "
msg += "which is usually causing problems "
msg += "in this kind of situations? [Y/n]"
conf.skipUrlEncode = readInput(msg, default="Y").upper() != "N"
if place not in (PLACE.POST, PLACE.SOAP, PLACE.CUSTOM_POST) and hasattr(post, UNENCODED_ORIGINAL_VALUE):
post = getattr(post, UNENCODED_ORIGINAL_VALUE)
elif not conf.skipUrlEncode and place not in (PLACE.SOAP,):
post = urlencode(post)
if timeBasedCompare: if timeBasedCompare:
if len(kb.responseTimes) < MIN_TIME_RESPONSES: if len(kb.responseTimes) < MIN_TIME_RESPONSES: