aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 49934e4d..1bda219f 100644
--- a/mitmproxy/tools/console/consoleaddons.py
+++ b/mitmproxy/tools/console/consoleaddons.py
@@ -329,9 +329,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: