diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/upsidedownternet.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/upsidedownternet.py b/examples/upsidedownternet.py index b7489cb6..9aac9f05 100644 --- a/examples/upsidedownternet.py +++ b/examples/upsidedownternet.py @@ -1,4 +1,4 @@ -import cStringIO +from six.moves import cStringIO as StringIO from PIL import Image from mitmproxy.models import decoded @@ -7,9 +7,9 @@ def response(context, flow): if flow.response.headers.get("content-type", "").startswith("image"): with decoded(flow.response): # automatically decode gzipped responses. try: - s = cStringIO.StringIO(flow.response.content) + s = StringIO(flow.response.content) img = Image.open(s).rotate(180) - s2 = cStringIO.StringIO() + s2 = StringIO() img.save(s2, "png") flow.response.content = s2.getvalue() flow.response.headers["content-type"] = "image/png" |