aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/tools
diff options
context:
space:
mode:
authorItai Sadan <itaisod@gmail.com>2020-01-17 16:22:38 +0200
committerItai Sadan <itaisod@gmail.com>2020-01-17 16:22:38 +0200
commit825bc9aa47d63876d81b6cf25817d1669d33cfe8 (patch)
tree5cf4dc972d0157c40ec109f17d2d9be81cddd09d /mitmproxy/tools
parent6e57d60f7d821998bf38323a2c0f881eecbbbaa8 (diff)
downloadmitmproxy-825bc9aa47d63876d81b6cf25817d1669d33cfe8.tar.gz
mitmproxy-825bc9aa47d63876d81b6cf25817d1669d33cfe8.tar.bz2
mitmproxy-825bc9aa47d63876d81b6cf25817d1669d33cfe8.zip
Fix command quotes and error logging
Fixes error when trying to manually set "multipart form" view. Also fixes "(more in eventlog)" prompt where nothing is written to the event log.
Diffstat (limited to 'mitmproxy/tools')
-rw-r--r--mitmproxy/tools/console/consoleaddons.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mitmproxy/tools/console/consoleaddons.py b/mitmproxy/tools/console/consoleaddons.py
index 7fcd9b48..ac92c96f 100644
--- a/mitmproxy/tools/console/consoleaddons.py
+++ b/mitmproxy/tools/console/consoleaddons.py
@@ -276,11 +276,11 @@ class ConsoleAddon:
def callback(opt):
# We're now outside of the call context...
- repl = " ".join(command_lexer.quote(x) for x in args)
- repl = repl.replace("{choice}", opt)
+ repl = " ".join(command_lexer.quote(x.replace("{choice}", opt)) for x in args)
try:
self.master.commands.execute(subcmd + " " + repl)
except exceptions.CommandError as e:
+ ctx.log.error(str(e))
signals.status_message.send(message=str(e))
self.master.overlay(
@@ -539,9 +539,10 @@ class ConsoleAddon:
raise exceptions.CommandError("Invalid flowview mode.")
try:
- cmd = 'view.settings.setval @focus flowview_mode_%s %s' % (idx, mode)
+ cmd = 'view.settings.setval @focus flowview_mode_%s %s' % (idx, command_lexer.quote(mode))
self.master.commands.execute(cmd)
except exceptions.CommandError as e:
+ ctx.log.error(e)
signals.status_message.send(message=str(e))
@command.command("console.flowview.mode.options")