diff options
author | Stephen Altamirano <stephen@evilrobotstuff.com> | 2011-07-21 20:22:13 -0700 |
---|---|---|
committer | Stephen Altamirano <stephen@evilrobotstuff.com> | 2011-07-21 20:22:13 -0700 |
commit | 74d8b18408783172ecdba5ec3947a4ecb590d70d (patch) | |
tree | 7efcffaf2ae2d5476413f9a95dc6f8435e7d252f /libmproxy/console.py | |
parent | 5936a48e592b3f45b83dc76feab8bb8b5df81da1 (diff) | |
download | mitmproxy-74d8b18408783172ecdba5ec3947a4ecb590d70d.tar.gz mitmproxy-74d8b18408783172ecdba5ec3947a4ecb590d70d.tar.bz2 mitmproxy-74d8b18408783172ecdba5ec3947a4ecb590d70d.zip |
Removes should_autodecode attribute from Response. Adds commandline option 'd' to toggle autodecode, adds togglable option 'd' to do the same
Diffstat (limited to 'libmproxy/console.py')
-rw-r--r-- | libmproxy/console.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/libmproxy/console.py b/libmproxy/console.py index c76f9314..3017669e 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -311,9 +311,8 @@ class ConnectionView(WWrap): def _conn_text(self, conn, viewmode): if conn: e = conn.headers["content-encoding"] - if e and conn.should_autodecode: + if e and self.master.autodecode: e = e[0] - conn.should_autodecode = False else: e = "identity" return self.master._cached_conn_text( @@ -673,6 +672,8 @@ class StatusBar(WWrap): opts.append("anticache") if self.master.anticomp: opts.append("anticomp") + if self.master.autodecode: + opts.append("autodecode") if not self.master.refresh_server_playback: opts.append("norefresh") if self.master.killextra: @@ -806,6 +807,7 @@ class Options(object): __slots__ = [ "anticache", "anticomp", + "autodecode", "client_replay", "debug", "keepserving", @@ -886,6 +888,7 @@ class ConsoleMaster(flow.FlowMaster): self.refresh_server_playback = options.refresh_server_playback self.anticache = options.anticache self.anticomp = options.anticomp + self.autodecode = options.autodecode self.killextra = options.kill self.rheaders = options.rheaders @@ -1276,17 +1279,17 @@ class ConsoleMaster(flow.FlowMaster): ("o", "toggle options:"), (None, highlight_key("anticache", "a") + - [ - - ("text", ": modify requests to prevent cached responses") - - ] + [("text", ": modify requests to prevent cached responses")] ), (None, highlight_key("anticomp", "c") + [("text", ": modify requests to try to prevent compressed responses")] ), (None, + highlight_key("autodecode", "d") + + [("text", ": automatically decode compressed responses")] + ), + (None, highlight_key("killextra", "k") + [("text", ": kill requests not part of server replay")] ), @@ -1581,6 +1584,7 @@ class ConsoleMaster(flow.FlowMaster): ( ("anticache", "a"), ("anticomp", "c"), + ("autodecode", "d"), ("killextra", "k"), ("norefresh", "n"), ), @@ -1624,6 +1628,8 @@ class ConsoleMaster(flow.FlowMaster): self.anticache = not self.anticache if a == "c": self.anticomp = not self.anticomp + elif a == "d": + self.autodecode = not self.autodecode elif a == "k": self.killextra = not self.killextra elif a == "n": |