From cd744592f6dfebf9ba00ce8a35828b49fec1af5c Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 8 Feb 2016 01:11:52 +0100 Subject: remove duplicate code --- libmproxy/models/http.py | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'libmproxy/models') 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 -- cgit v1.2.3