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

Skip to content

Commit 62f8f8d

Browse files
committed
bug fix (thanks to zhen zhou)
1 parent 81ca6f0 commit 62f8f8d

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/request/connect.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,13 +539,14 @@ def queryPage(value=None, place=None, content=False, getRatioValue=False, silent
539539
value = urlEncodeCookieValues(value)
540540

541541
elif place:
542-
if place in (PLACE.GET, PLACE.POST):
542+
if place in (PLACE.GET, PLACE.POST, PLACE.URI):
543543
# payloads in GET and/or POST need to be urlencoded
544544
# throughly without safe chars (especially & and =)
545545
# addendum: as we support url encoding in tampering
546546
# functions therefore we need to use % as a safe char
547-
payload = urlencode(payload, "%", False, True)
548-
value = agent.replacePayload(value, payload)
547+
if place != PLACE.URI or ('?' in value and value.find('?') < value.find(payload)):
548+
payload = urlencode(payload, "%", False, True)
549+
value = agent.replacePayload(value, payload)
549550
elif place == PLACE.SOAP:
550551
# payloads in SOAP should have chars > and < replaced
551552
# with their HTML encoded counterparts

0 commit comments

Comments
 (0)