mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
Refresh current connection when toggling autodecode.
Also fix the unit tests I forgot to commit...
This commit is contained in:
parent
8cc0469ee7
commit
a817db5bd6
@ -1728,6 +1728,7 @@ class ConsoleMaster(flow.FlowMaster):
|
|||||||
self.anticomp = not self.anticomp
|
self.anticomp = not self.anticomp
|
||||||
elif a == "d":
|
elif a == "d":
|
||||||
self.autodecode = not self.autodecode
|
self.autodecode = not self.autodecode
|
||||||
|
self.refresh_connection(self.currentflow)
|
||||||
elif a == "k":
|
elif a == "k":
|
||||||
self.killextra = not self.killextra
|
self.killextra = not self.killextra
|
||||||
elif a == "n":
|
elif a == "n":
|
||||||
|
@ -10,8 +10,7 @@ class uidentity(libpry.AutoTree):
|
|||||||
assert "string" == encoding.encode("identity", "string")
|
assert "string" == encoding.encode("identity", "string")
|
||||||
|
|
||||||
def test_fallthrough(self):
|
def test_fallthrough(self):
|
||||||
assert "string" == encoding.decode("nonexistent encoding", "string")
|
assert None == encoding.decode("nonexistent encoding", "string")
|
||||||
assert "string" == encoding.encode("nonexistent encoding", "string")
|
|
||||||
|
|
||||||
class ugzip(libpry.AutoTree):
|
class ugzip(libpry.AutoTree):
|
||||||
def test_simple(self):
|
def test_simple(self):
|
||||||
|
@ -143,7 +143,7 @@ class uRequest(libpry.AutoTree):
|
|||||||
r.headers["content-encoding"] = ["identity"]
|
r.headers["content-encoding"] = ["identity"]
|
||||||
r.content = "falafel"
|
r.content = "falafel"
|
||||||
r.decode()
|
r.decode()
|
||||||
assert r.headers["content-encoding"] == ["identity"]
|
assert not r.headers["content-encoding"]
|
||||||
assert r.content == "falafel"
|
assert r.content == "falafel"
|
||||||
|
|
||||||
r = tutils.treq()
|
r = tutils.treq()
|
||||||
@ -160,7 +160,7 @@ class uRequest(libpry.AutoTree):
|
|||||||
assert r.headers["content-encoding"] == ["gzip"]
|
assert r.headers["content-encoding"] == ["gzip"]
|
||||||
assert r.content != "falafel"
|
assert r.content != "falafel"
|
||||||
r.decode()
|
r.decode()
|
||||||
assert r.headers["content-encoding"] == ["identity"]
|
assert not r.headers["content-encoding"]
|
||||||
assert r.content == "falafel"
|
assert r.content == "falafel"
|
||||||
|
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ class uResponse(libpry.AutoTree):
|
|||||||
r.headers["content-encoding"] = ["identity"]
|
r.headers["content-encoding"] = ["identity"]
|
||||||
r.content = "falafel"
|
r.content = "falafel"
|
||||||
r.decode()
|
r.decode()
|
||||||
assert r.headers["content-encoding"] == ["identity"]
|
assert not r.headers["content-encoding"]
|
||||||
assert r.content == "falafel"
|
assert r.content == "falafel"
|
||||||
|
|
||||||
r = tutils.tresp()
|
r = tutils.tresp()
|
||||||
@ -250,7 +250,7 @@ class uResponse(libpry.AutoTree):
|
|||||||
assert r.headers["content-encoding"] == ["gzip"]
|
assert r.headers["content-encoding"] == ["gzip"]
|
||||||
assert r.content != "falafel"
|
assert r.content != "falafel"
|
||||||
r.decode()
|
r.decode()
|
||||||
assert r.headers["content-encoding"] == ["identity"]
|
assert not r.headers["content-encoding"]
|
||||||
assert r.content == "falafel"
|
assert r.content == "falafel"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user