shlex.quote

This commit is contained in:
Miroslav 2018-02-19 23:50:46 +02:00
parent 4e03326ec5
commit d6d2f55a4f

View File

@ -1,4 +1,5 @@
import csv import csv
import shlex
import typing import typing
from mitmproxy import ctx from mitmproxy import ctx
@ -259,7 +260,7 @@ class ConsoleAddon:
def callback(opt): def callback(opt):
# We're now outside of the call context... # We're now outside of the call context...
repl = "\"" + " ".join(args) + "\"" repl = shlex.quote(" ".join(args))
repl = repl.replace("{choice}", opt) repl = repl.replace("{choice}", opt)
try: try:
self.master.commands.call(subcmd + " " + repl) self.master.commands.call(subcmd + " " + repl)