diff options
author | Aldo Cortesi <aldo@corte.si> | 2017-12-16 10:30:08 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2017-12-17 10:11:02 +1300 |
commit | cd913d598da421b4c4e264e029be5f13e3e009bb (patch) | |
tree | 7fb418ea9c7d57c9006f0e322ce8127df5d9d390 /mitmproxy/command.py | |
parent | 50a94db2cc2f3107f6f94c1e1407cb6840d1da08 (diff) | |
download | mitmproxy-cd913d598da421b4c4e264e029be5f13e3e009bb.tar.gz mitmproxy-cd913d598da421b4c4e264e029be5f13e3e009bb.tar.bz2 mitmproxy-cd913d598da421b4c4e264e029be5f13e3e009bb.zip |
command cuts: add completion
- Remove shortcuts for request, response, etc. - we don't need them if we have completion
- Restrict cuts specification to a set of prefixes
- Extend cuts to add a few more items
Diffstat (limited to 'mitmproxy/command.py')
-rw-r--r-- | mitmproxy/command.py | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/mitmproxy/command.py b/mitmproxy/command.py index 82bad4fa..7d7fa735 100644 --- a/mitmproxy/command.py +++ b/mitmproxy/command.py @@ -30,7 +30,46 @@ Cuts = typing.Sequence[ class Cut(str): - pass + # This is an awkward location for these values, but it's better than having + # the console core import and depend on an addon. FIXME: Add a way for + # addons to add custom types and manage their completion and validation. + valid_prefixes = [ + "request.method", + "request.scheme", + "request.host", + "request.http_version", + "request.port", + "request.path", + "request.url", + "request.text", + "request.content", + "request.raw_content", + "request.timestamp_start", + "request.timestamp_end", + "request.header[", + + "response.status_code", + "response.reason", + "response.text", + "response.content", + "response.timestamp_start", + "response.timestamp_end", + "response.raw_content", + "response.header[", + + "client_conn.address.port", + "client_conn.address.host", + "client_conn.tls_version", + "client_conn.sni", + "client_conn.ssl_established", + + "server_conn.address.port", + "server_conn.address.host", + "server_conn.ip_address.host", + "server_conn.tls_version", + "server_conn.sni", + "server_conn.ssl_established", + ] class Path(str): |