Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f336afa

Browse files
committed
Implementation for Issue #108
1 parent 53cb105 commit f336afa

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

lib/request/connect.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,20 @@ def _randomizeParameter(paramString, randomParameter):
653653
get += "%s%s=%s" % (delimiter, name, value)
654654

655655
get = urlencode(get, limit=True)
656-
if post and place not in (PLACE.POST, PLACE.SOAP, PLACE.CUSTOM_POST) and hasattr(post, UNENCODED_ORIGINAL_VALUE):
657-
post = getattr(post, UNENCODED_ORIGINAL_VALUE)
658-
elif not conf.skipUrlEncode and place not in (PLACE.SOAP,):
659-
post = urlencode(post)
656+
if post:
657+
if conf.skipUrlEncode is None:
658+
_ = (post or "").strip()
659+
if _.startswith("<") and _.endswith(">"):
660+
msg = "provided POST data looks "
661+
msg += "like it's in XML format. "
662+
msg += "Do you want to turn off URL encoding "
663+
msg += "which is usually causing problems "
664+
msg += "in this kind of situations? [Y/n]"
665+
conf.skipUrlEncode = readInput(msg, default="Y").upper() != "N"
666+
if place not in (PLACE.POST, PLACE.SOAP, PLACE.CUSTOM_POST) and hasattr(post, UNENCODED_ORIGINAL_VALUE):
667+
post = getattr(post, UNENCODED_ORIGINAL_VALUE)
668+
elif not conf.skipUrlEncode and place not in (PLACE.SOAP,):
669+
post = urlencode(post)
660670

661671
if timeBasedCompare:
662672
if len(kb.responseTimes) < MIN_TIME_RESPONSES:

0 commit comments

Comments
 (0)