From eb914924ab56b28f982660c0600f6ae8818af204 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 20 May 2016 13:59:42 -0700 Subject: [PATCH] fix #1099 --- mitmproxy/console/flowview.py | 2 +- netlib/http/message.py | 6 ++++++ netlib/multidict.py | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mitmproxy/console/flowview.py b/mitmproxy/console/flowview.py index 3538c4ad9..2010cecd2 100644 --- a/mitmproxy/console/flowview.py +++ b/mitmproxy/console/flowview.py @@ -186,7 +186,7 @@ class FlowView(tabs.Tabs): viewmode, message, limit, - (bytes(message.headers), message.content) # Cache invalidation + message # Cache invalidation ) def _get_content_view(self, viewmode, message, max_lines, _): diff --git a/netlib/http/message.py b/netlib/http/message.py index db4054b14..76affeece 100644 --- a/netlib/http/message.py +++ b/netlib/http/message.py @@ -26,6 +26,9 @@ class MessageData(utils.Serializable): def __ne__(self, other): return not self.__eq__(other) + def __hash__(self): + return hash(frozenset(self.__dict__.items())) + def set_state(self, state): for k, v in state.items(): if k == "headers": @@ -52,6 +55,9 @@ class Message(utils.Serializable): def __ne__(self, other): return not self.__eq__(other) + def __hash__(self): + return hash(self.data) ^ 1 + def get_state(self): return self.data.get_state() diff --git a/netlib/multidict.py b/netlib/multidict.py index a359d46b0..ec1b24d8b 100644 --- a/netlib/multidict.py +++ b/netlib/multidict.py @@ -87,6 +87,9 @@ class MultiDict(MutableMapping, Serializable): def __ne__(self, other): return not self.__eq__(other) + def __hash__(self): + return hash(self.fields) + def get_all(self, key): """ Return the list of all values for a given key.