aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmproxy/flow.py2
-rw-r--r--test/test_flow.py7
2 files changed, 8 insertions, 1 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py
index dd43a24f..5f5cad4c 100644
--- a/libmproxy/flow.py
+++ b/libmproxy/flow.py
@@ -538,7 +538,7 @@ class Response(HTTPMsg):
self.headers = ODictCaseless._from_state(state["headers"])
self.content = state["content"]
self.timestamp = state["timestamp"]
- self.cert = state["cert"]
+ self.cert = certutils.SSLCert.from_pem(state["cert"]) if state["cert"] else None
def _get_state(self):
return dict(
diff --git a/test/test_flow.py b/test/test_flow.py
index 1394a668..1dd44dd2 100644
--- a/test/test_flow.py
+++ b/test/test_flow.py
@@ -192,6 +192,13 @@ class TestFlow:
f.revert()
assert f.request.content == "foo"
+ def test_backup_idempotence(self):
+ f = tutils.tflow_full()
+ f.backup()
+ f.revert()
+ f.backup()
+ f.revert()
+
def test_getset_state(self):
f = tutils.tflow()
f.response = tutils.tresp(f.request)