aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/flow.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-02-05 14:33:17 +0100
committerMaximilian Hils <git@maximilianhils.com>2014-02-05 14:33:17 +0100
commitd864a326d25815a240aa5ac34171e48687311f29 (patch)
tree8041cd128cc7a261687f696cdc33e4e6707e66d9 /libmproxy/flow.py
parent6a53ae5fd37b516074f9bf46cffab015f6626b9e (diff)
downloadmitmproxy-d864a326d25815a240aa5ac34171e48687311f29.tar.gz
mitmproxy-d864a326d25815a240aa5ac34171e48687311f29.tar.bz2
mitmproxy-d864a326d25815a240aa5ac34171e48687311f29.zip
fix all tests except those using set_url and get_url
Diffstat (limited to 'libmproxy/flow.py')
-rw-r--r--libmproxy/flow.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py
index b1971469..bf9171a7 100644
--- a/libmproxy/flow.py
+++ b/libmproxy/flow.py
@@ -174,7 +174,7 @@ class ClientPlaybackState:
if self.flows and not self.current:
n = self.flows.pop(0)
n.request.reply = controller.DummyReply()
- n.request.client_conn = None
+ n.client_conn = None
self.current = master.handle_request(n.request)
if not testing and not self.current.response:
master.replay_request(self.current) # pragma: no cover
@@ -249,9 +249,10 @@ class StickyCookieState:
"""
Returns a (domain, port, path) tuple.
"""
+ raise NotImplementedError
return (
m["domain"] or f.request.host,
- f.request.port,
+ f.server_conn.address.port,
m["path"] or "/"
)
@@ -297,6 +298,7 @@ class StickyAuthState:
self.hosts = {}
def handle_request(self, f):
+ raise NotImplementedError
if "authorization" in f.request.headers:
self.hosts[f.request.host] = f.request.headers["authorization"]
elif f.match(self.flt):
@@ -665,11 +667,10 @@ class FlowMaster(controller.Master):
return f
def handle_request(self, r):
- if False and r.is_live(): # FIXME
+ if r.flow.client_conn and r.flow.client_conn.wfile:
app = self.apps.get(r)
if app:
- # FIXME: for the tcp proxy, use flow.client_conn.wfile
- err = app.serve(r, r.wfile, **{"mitmproxy.master": self})
+ err = app.serve(r, r.flow.client_conn.wfile, **{"mitmproxy.master": self})
if err:
self.add_event("Error in wsgi app. %s"%err, "error")
r.reply(KILL)