Remove unrelated focus options for TCP flow details

This commit is contained in:
Nikita Stupin 2020-05-29 20:34:30 +03:00
parent c22129ccb7
commit a15d591a4e

View File

@ -383,23 +383,30 @@ class ConsoleAddon:
"""
Possible components for console.edit.focus.
"""
return [
"cookies",
"urlencoded form",
"multipart form",
"path",
"method",
"query",
"reason",
"request-headers",
"response-headers",
"request-body",
"response-body",
"status_code",
"set-cookies",
"url",
"tcp-message"
]
flow = self.master.view.focus.flow
focus_options = []
if type(flow) == tcp.TCPFlow:
focus_options = ["tcp-message"]
elif type(flow) == http.HTTPFlow:
focus_options = [
"cookies",
"urlencoded form",
"multipart form",
"path",
"method",
"query",
"reason",
"request-headers",
"response-headers",
"request-body",
"response-body",
"status_code",
"set-cookies",
"url",
]
return focus_options
@command.command("console.edit.focus")
@command.argument("flow_part", type=mitmproxy.types.Choice("console.edit.focus.options"))