aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/tools
diff options
context:
space:
mode:
Diffstat (limited to 'mitmproxy/tools')
-rw-r--r--mitmproxy/tools/console/consoleaddons.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/tools/console/consoleaddons.py b/mitmproxy/tools/console/consoleaddons.py
index a65b26e1..7772545d 100644
--- a/mitmproxy/tools/console/consoleaddons.py
+++ b/mitmproxy/tools/console/consoleaddons.py
@@ -334,9 +334,9 @@ class ConsoleAddon:
correct viewier, and fall back to the programs in $PAGER or $EDITOR
if necessary.
"""
- fpart = getattr(f, part)
+ fpart = getattr(f, part, None)
if not fpart:
- raise exceptions.CommandError("Could not view part %s." % part)
+ raise exceptions.CommandError("Part must be either request or response, not %s." % part)
t = fpart.headers.get("content-type")
content = fpart.get_content(strict=False)
if not content: