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

Skip to content

Commit 6afc9bf

Browse files
committed
Minor bug fix: there will always be only one pair of delimiters as we add it for each place
1 parent 3a48bee commit 6afc9bf

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

lib/core/agent.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -623,13 +623,10 @@ def removePayloadDelimiters(self, inpStr, urlencode_=True):
623623
retVal = inpStr
624624

625625
if inpStr:
626-
if urlencode_:
627-
regObj = getCompiledRegex("(?P<result>%s.*?%s)" % (PAYLOAD_DELIMITER, PAYLOAD_DELIMITER))
626+
retVal = retVal.replace(PAYLOAD_DELIMITER, '')
628627

629-
for match in regObj.finditer(inpStr):
630-
retVal = retVal.replace(match.group("result"), urlencode(match.group("result")[1:-1], convall=True))
631-
else:
632-
retVal = retVal.replace(PAYLOAD_DELIMITER, '')
628+
if urlencode_:
629+
retVal = urlencode(retVal)
633630

634631
return retVal
635632

0 commit comments

Comments
 (0)