aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy.py
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r--libmproxy/proxy.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index 0c142959..75c5bf8a 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -134,11 +134,14 @@ class HTTPMsg(controller.Msg):
Content-Encoding header and changing Content-Encoding header to
'identity'.
"""
+ ce = self.headers["content-encoding"]
+ if not ce or ce[0] not in encoding.ENCODINGS:
+ return
self.content = encoding.decode(
- (self.headers["content-encoding"] or ["identity"])[0],
+ ce[0],
self.content
)
- self.headers["content-encoding"] = ["identity"]
+ del self.headers["content-encoding"]
def encode(self, e):
"""