aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-08-09 00:53:16 +0200
committerMaximilian Hils <git@maximilianhils.com>2014-08-09 00:53:16 +0200
commitc88613f5963c804d33fe2a8868ddbb0634b3d5ad (patch)
tree30a0323693bbb2da06cd2e7b37d208312c960765 /libmproxy/protocol
parent2e6a69828703778e713589ddcb983e39faf5d61e (diff)
downloadmitmproxy-c88613f5963c804d33fe2a8868ddbb0634b3d5ad.tar.gz
mitmproxy-c88613f5963c804d33fe2a8868ddbb0634b3d5ad.tar.bz2
mitmproxy-c88613f5963c804d33fe2a8868ddbb0634b3d5ad.zip
fix replay form
Diffstat (limited to 'libmproxy/protocol')
-rw-r--r--libmproxy/protocol/http.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index b8372d5a..eec62916 100644
--- a/libmproxy/protocol/http.py
+++ b/libmproxy/protocol/http.py
@@ -1135,7 +1135,9 @@ class RequestReplayThread(threading.Thread):
def run(self):
try:
r = self.flow.request
+ form_out_backup = r.form_out
+ r.form_out = self.config.http_form_out
server_address, server_ssl = False, False
if self.config.get_upstream_server:
try:
@@ -1145,7 +1147,7 @@ class RequestReplayThread(threading.Thread):
except proxy.ProxyError: # this will fail in transparent mode
pass
if not server_address:
- server_address = self.flow.server_conn.address()
+ server_address = (r.get_host(), r.get_port())
server = ServerConnection(server_address, None)
server.connect()
@@ -1153,6 +1155,7 @@ class RequestReplayThread(threading.Thread):
if server_ssl or r.get_scheme() == "https":
if self.config.http_form_out == "absolute":
send_connect_request(server, r.get_host(), r.get_port())
+ r.form_out = "relative"
server.establish_ssl(self.config.clientcerts,
self.flow.server_conn.sni)
server.send(r._assemble())
@@ -1161,4 +1164,6 @@ class RequestReplayThread(threading.Thread):
self.channel.ask("response", self.flow.response)
except (proxy.ProxyError, http.HttpError, tcp.NetLibError), v:
self.flow.error = Error(repr(v))
- self.channel.ask("error", self.flow.error) \ No newline at end of file
+ self.channel.ask("error", self.flow.error)
+ finally:
+ r.form_out = form_out_backup \ No newline at end of file