diff options
Diffstat (limited to 'libmproxy/utils.py')
-rw-r--r-- | libmproxy/utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libmproxy/utils.py b/libmproxy/utils.py index 82ddf8fc..0614a464 100644 --- a/libmproxy/utils.py +++ b/libmproxy/utils.py @@ -156,6 +156,16 @@ class MultiDict: for j in self[i]: yield (i, j) + def get_state(self): + return list(self.itemPairs()) + + @classmethod + def from_state(klass, state): + md = klass() + for i in state: + md.append(*i) + return md + class Headers(MultiDict): """ |