aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol
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/protocol
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/protocol')
-rw-r--r--libmproxy/protocol/http.py5
-rw-r--r--libmproxy/protocol/primitives.py4
2 files changed, 6 insertions, 3 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index be60f374..636e1b07 100644
--- a/libmproxy/protocol/http.py
+++ b/libmproxy/protocol/http.py
@@ -56,7 +56,7 @@ class decoded(object):
class HTTPMessage(stateobject.SimpleStateObject):
def __init__(self):
- self.flow = None # Will usually set by backref mixin
+ self.flow = None # will usually be set by the flow backref mixin
"""@type: HTTPFlow"""
def get_decoded_content(self):
@@ -197,7 +197,7 @@ class HTTPRequest(HTTPMessage):
timestamp_end: Timestamp indicating when request transmission ended
"""
def __init__(self, form_in, method, scheme, host, port, path, httpversion, headers, content,
- timestamp_start, timestamp_end, form_out=None):
+ timestamp_start=None, timestamp_end=None, form_out=None):
assert isinstance(headers, ODictCaseless) or not headers
HTTPMessage.__init__(self)
@@ -758,7 +758,6 @@ class HTTPFlow(Flow):
"""
Continue with the flow - called after an intercept().
"""
- assert self.intercepting
if self.request:
if not self.request.reply.acked:
self.request.reply()
diff --git a/libmproxy/protocol/primitives.py b/libmproxy/protocol/primitives.py
index f77e097b..f3fdd245 100644
--- a/libmproxy/protocol/primitives.py
+++ b/libmproxy/protocol/primitives.py
@@ -41,6 +41,7 @@ class Error(stateobject.SimpleStateObject):
@type msg: str
@type timestamp: float
"""
+ self.flow = None # will usually be set by the flow backref mixin
self.msg = msg
self.timestamp = timestamp or utils.timestamp()
@@ -88,6 +89,9 @@ class Flow(stateobject.SimpleStateObject, _BackreferenceMixin):
f._load_state(state)
return f
+ def __eq__(self, other):
+ return self is other
+
def copy(self):
f = copy.copy(self)