aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-02-08 01:11:52 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-02-08 01:11:52 +0100
commitcd744592f6dfebf9ba00ce8a35828b49fec1af5c (patch)
tree2a7548be6cee867161b8ede73fea69d11df8dd91
parent2654cd87afcba318d2cb6ba716a6e2106f24ccb7 (diff)
downloadmitmproxy-cd744592f6dfebf9ba00ce8a35828b49fec1af5c.tar.gz
mitmproxy-cd744592f6dfebf9ba00ce8a35828b49fec1af5c.tar.bz2
mitmproxy-cd744592f6dfebf9ba00ce8a35828b49fec1af5c.zip
remove duplicate code
-rw-r--r--libmproxy/models/http.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/libmproxy/models/http.py b/libmproxy/models/http.py
index 60fcb92c..d3919adf 100644
--- a/libmproxy/models/http.py
+++ b/libmproxy/models/http.py
@@ -48,33 +48,6 @@ class MessageMixin(stateobject.StateObject):
return self.content
return encoding.decode(ce, self.content)
- def decode(self):
- """
- Decodes body based on the current Content-Encoding header, then
- removes the header. If there is no Content-Encoding header, no
- action is taken.
-
- Returns True if decoding succeeded, False otherwise.
- """
- ce = self.headers.get("content-encoding")
- if not self.content or ce not in encoding.ENCODINGS:
- return False
- data = encoding.decode(ce, self.content)
- if data is None:
- return False
- self.content = data
- self.headers.pop("content-encoding", None)
- return True
-
- def encode(self, e):
- """
- Encodes body with the encoding e, where e is "gzip", "deflate"
- or "identity".
- """
- # FIXME: Error if there's an existing encoding header?
- self.content = encoding.encode(e, self.content)
- self.headers["content-encoding"] = e
-
def copy(self):
c = copy.copy(self)
if hasattr(self, "data"): # FIXME remove condition