From d15ddfad14052b7fd971f3b82bbb86e7ec39c40b Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 23 Nov 2016 22:47:36 +0100 Subject: [PATCH] fix contentview attributes --- mitmproxy/contentviews.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mitmproxy/contentviews.py b/mitmproxy/contentviews.py index 4f2838eef..f6a2262c9 100644 --- a/mitmproxy/contentviews.py +++ b/mitmproxy/contentviews.py @@ -626,11 +626,14 @@ def get_message_content_view(viewname, message): if content is None: return "", iter([[("error", "content missing")]]), None - query = message.query if isinstance(message, http.Request) else None - headers = message.headers if isinstance(message, http.Message) else None + metadata = {} + if isinstance(message, http.Request): + metadata["query"] = message.query + if isinstance(message, http.Message): + metadata["headers"] = message.headers description, lines, error = get_content_view( - viewmode, content, headers=headers, query=query + viewmode, content, **metadata ) if enc: