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

Skip to content

Commit 1f5e660

Browse files
committed
Fixes #1357
1 parent 76c8ce0 commit 1f5e660

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lib/request/connect.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,12 @@ def _randomizeParameter(paramString, randomParameter):
893893
originals = {}
894894
keywords = keyword.kwlist
895895

896-
for item in filter(None, (get, post if not kb.postHint else None)):
896+
if not get and PLACE.URI in conf.parameters:
897+
query = urlparse.urlsplit(uri).query or ""
898+
else:
899+
query = None
900+
901+
for item in filter(None, (get, post if not kb.postHint else None, query)):
897902
for part in item.split(delimiter):
898903
if '=' in part:
899904
name, value = part.split('=', 1)
@@ -956,6 +961,10 @@ def _randomizeParameter(paramString, randomParameter):
956961
found = True
957962
post = re.sub(regex, "\g<1>%s\g<3>" % value, post)
958963

964+
if re.search(regex, (query or "")):
965+
found = True
966+
uri = re.sub(regex.replace(r"\A", r"\?"), "\g<1>%s\g<3>" % value, uri)
967+
959968
regex = r"((\A|%s)%s=).+?(%s|\Z)" % (re.escape(conf.cookieDel or DEFAULT_COOKIE_DELIMITER), name, re.escape(conf.cookieDel or DEFAULT_COOKIE_DELIMITER))
960969
if re.search(regex, (cookie or "")):
961970
found = True

0 commit comments

Comments
 (0)