diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-03-26 11:39:25 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-03-26 11:48:35 +1300 |
commit | a2fddb4404d2a1edc5bb39d306a9ac5eb0417906 (patch) | |
tree | 0b075d296cde65b18d3f3a6f2c48e90afcb22214 /libmproxy/console | |
parent | d1879652336919e80d57dc283581564faf1977a2 (diff) | |
download | mitmproxy-a2fddb4404d2a1edc5bb39d306a9ac5eb0417906.tar.gz mitmproxy-a2fddb4404d2a1edc5bb39d306a9ac5eb0417906.tar.bz2 mitmproxy-a2fddb4404d2a1edc5bb39d306a9ac5eb0417906.zip |
Add image pretty viewer to forcing options.
Diffstat (limited to 'libmproxy/console')
-rw-r--r-- | libmproxy/console/contentview.py | 1 | ||||
-rw-r--r-- | libmproxy/console/flowview.py | 19 |
2 files changed, 16 insertions, 4 deletions
diff --git a/libmproxy/console/contentview.py b/libmproxy/console/contentview.py index 2706358c..4f468b8f 100644 --- a/libmproxy/console/contentview.py +++ b/libmproxy/console/contentview.py @@ -47,6 +47,7 @@ CONTENT_TYPES_MAP = { "image/png": VIEW_CONTENT_PRETTY_TYPE_IMAGE, "image/jpeg": VIEW_CONTENT_PRETTY_TYPE_IMAGE, "image/gif": VIEW_CONTENT_PRETTY_TYPE_IMAGE, + "image/vnd.microsoft.icon": VIEW_CONTENT_PRETTY_TYPE_IMAGE, "image/x-icon": VIEW_CONTENT_PRETTY_TYPE_IMAGE, } diff --git a/libmproxy/console/flowview.py b/libmproxy/console/flowview.py index 011d3d74..dfda1d63 100644 --- a/libmproxy/console/flowview.py +++ b/libmproxy/console/flowview.py @@ -48,16 +48,24 @@ def _mkhelp(): [("text", ": automatic detection")] ), (None, - common.highlight_key("json", "j") + - [("text", ": format as JSON")] + common.highlight_key("image", "i") + + [("text", ": Image")] + ), + (None, + common.highlight_key("javascript", "j") + + [("text", ": JavaScript")] + ), + (None, + common.highlight_key("json", "s") + + [("text", ": JSON")] ), (None, common.highlight_key("urlencoded", "u") + - [("text", ": format as URL-encoded data")] + [("text", ": URL-encoded data")] ), (None, common.highlight_key("xml", "x") + - [("text", ": format as XML")] + [("text", ": XML")] ), ("V", "revert changes to request"), ("v", "view body in external viewer"), @@ -364,6 +372,8 @@ class FlowView(common.WWrap): def change_pretty_type(self, t): if t == "a": self.view_body_pretty_type = contentview.VIEW_CONTENT_PRETTY_TYPE_AUTO + elif t == "i": + self.view_body_pretty_type = contentview.VIEW_CONTENT_PRETTY_TYPE_IMAGE elif t == "j": self.view_body_pretty_type = contentview.VIEW_CONTENT_PRETTY_TYPE_JAVASCRIPT elif t == "s": @@ -466,6 +476,7 @@ class FlowView(common.WWrap): "Pretty-Print format", ( ("auto detect", "a"), + ("image", "i"), ("javascript", "j"), ("json", "s"), ("urlencoded", "u"), |