diff options
author | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-02-08 09:52:29 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <Kriechi@users.noreply.github.com> | 2016-02-08 09:52:29 +0100 |
commit | 4ee1ad88fc440164985c8efc50c0be133a0053bc (patch) | |
tree | 210635d4aa964873f8054c80fcbeb2e9f94ce6ab /netlib/http/headers.py | |
parent | 4873547de3c65ba7c14cace4bca7b17368b2900d (diff) | |
parent | 655b521749efd5a600d342a1d95b67d32da280a8 (diff) | |
download | mitmproxy-4ee1ad88fc440164985c8efc50c0be133a0053bc.tar.gz mitmproxy-4ee1ad88fc440164985c8efc50c0be133a0053bc.tar.bz2 mitmproxy-4ee1ad88fc440164985c8efc50c0be133a0053bc.zip |
Merge pull request #120 from mitmproxy/model-cleanup
Model Cleanup
Diffstat (limited to 'netlib/http/headers.py')
-rw-r--r-- | netlib/http/headers.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/netlib/http/headers.py b/netlib/http/headers.py index 6eb9db92..78404796 100644 --- a/netlib/http/headers.py +++ b/netlib/http/headers.py @@ -14,7 +14,7 @@ except ImportError: # pragma: nocover import six -from netlib.utils import always_byte_args, always_bytes +from netlib.utils import always_byte_args, always_bytes, Serializable if six.PY2: # pragma: nocover _native = lambda x: x @@ -27,7 +27,7 @@ else: _always_byte_args = always_byte_args("utf-8", "surrogateescape") -class Headers(MutableMapping): +class Headers(MutableMapping, Serializable): """ Header class which allows both convenient access to individual headers as well as direct access to the underlying raw data. Provides a full dictionary interface. @@ -193,11 +193,10 @@ class Headers(MutableMapping): def copy(self): return Headers(copy.copy(self.fields)) - # Implement the StateObject protocol from mitmproxy def get_state(self): return tuple(tuple(field) for field in self.fields) - def load_state(self, state): + def set_state(self, state): self.fields = [list(field) for field in state] @classmethod |