diff options
author | Maximilian Hils <git@maximilianhils.com> | 2017-12-12 13:14:25 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2017-12-12 15:56:16 +0100 |
commit | 4d924dcfe2cca8c7adf1dcd9ca6aca54a6065d26 (patch) | |
tree | 69b4f4f77199a8afa7042ac42b2776e57dcdb62c | |
parent | 472d122c12c22f6cc5ebd2e139a2132c77267526 (diff) | |
download | mitmproxy-4d924dcfe2cca8c7adf1dcd9ca6aca54a6065d26.tar.gz mitmproxy-4d924dcfe2cca8c7adf1dcd9ca6aca54a6065d26.tar.bz2 mitmproxy-4d924dcfe2cca8c7adf1dcd9ca6aca54a6065d26.zip |
fix #2651
-rw-r--r-- | mitmproxy/tools/console/consoleaddons.py | 4 |
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: |