aboutsummaryrefslogtreecommitdiffstats
path: root/examples/upsidedownternet.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-09-11 12:13:39 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-09-11 12:13:39 +0200
commit7c186a4edbb0c6bc1f471d0db62dfc60008160a2 (patch)
tree89fb7e5b14cdfe9a0b61da828ddac8f355a3cdd0 /examples/upsidedownternet.py
parentb62498e125191beca3b49841eb5f1fb9a93a868a (diff)
parentdd414e485212e3cab612a66d5d858c1a766ace04 (diff)
downloadmitmproxy-7c186a4edbb0c6bc1f471d0db62dfc60008160a2.tar.gz
mitmproxy-7c186a4edbb0c6bc1f471d0db62dfc60008160a2.tar.bz2
mitmproxy-7c186a4edbb0c6bc1f471d0db62dfc60008160a2.zip
Merge branch 'master' into contentviews
Diffstat (limited to 'examples/upsidedownternet.py')
-rw-r--r--examples/upsidedownternet.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/upsidedownternet.py b/examples/upsidedownternet.py
index a6de97e4..f2e73047 100644
--- a/examples/upsidedownternet.py
+++ b/examples/upsidedownternet.py
@@ -1,10 +1,10 @@
import cStringIO
from PIL import Image
-from libmproxy.protocol.http import decoded
+from libmproxy.models import decoded
def response(context, flow):
- if flow.response.headers.get_first("content-type", "").startswith("image"):
+ if flow.response.headers.get("content-type", "").startswith("image"):
with decoded(flow.response): # automatically decode gzipped responses.
try:
s = cStringIO.StringIO(flow.response.content)
@@ -12,6 +12,6 @@ def response(context, flow):
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content = s2.getvalue()
- flow.response.headers["content-type"] = ["image/png"]
+ flow.response.headers["content-type"] = "image/png"
except: # Unknown image types etc.
pass