From 60baf5071edb3bb5978566be2b9222c0c7fdf726 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 17 Dec 2012 00:40:01 +0100 Subject: [PATCH] Patch for an Issue #302 --- lib/request/connect.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/request/connect.py b/lib/request/connect.py index a2f2fd026..cc5d1eb9e 100644 --- a/lib/request/connect.py +++ b/lib/request/connect.py @@ -615,10 +615,13 @@ class Connect(object): value = agent.replacePayload(value, payload) else: - if place != PLACE.URI or (value and payload and '?' in value and value.find('?') < value.find(payload)): + if place != PLACE.URI or (value and payload and '?' in value and re.search(r"\?.*%s" % re.escape(payload), value)): # GET, URI and Cookie need to be throughly URL encoded (POST is encoded down below) payload = urlencode(payload, '%', False, True) if place in (PLACE.GET, PLACE.COOKIE, PLACE.URI) and not skipUrlEncode else payload value = agent.replacePayload(value, payload) + elif place == PLACE.URI and (value and payload and '?' in value and re.search(r"%s.*\?" % re.escape(payload), value)): + payload = urlencode(payload, '%') + value = agent.replacePayload(value, payload) if conf.hpp: if not any(conf.url.lower().endswith(_.lower()) for _ in (WEB_API.ASP, WEB_API.ASPX)):