From 7629a43d82bb6090ebf9101383603f81f6f9940a Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 27 Aug 2011 09:24:04 +1200 Subject: [PATCH] README and minor felicities for script examples. --- examples/README | 9 +++++---- examples/upsidedownternet.py | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/README b/examples/README index edb70c512..696705a5d 100644 --- a/examples/README +++ b/examples/README @@ -1,5 +1,6 @@ - -add_header.py Simple script that just adds a header to every request. -stub.py Script stub with a method definition for every event. -stickycookies An example of writing a custom proxy with libmproxy +add_header.py Simple script that just adds a header to every request. +flowbasic Basic use of mitmproxy as a library. +stub.py Script stub with a method definition for every event. +stickycookies An example of writing a custom proxy with libmproxy. +upsidedownternet.py Rewrites traffic to turn PNGs upside down. diff --git a/examples/upsidedownternet.py b/examples/upsidedownternet.py index 28d34ca92..aaf8ff749 100644 --- a/examples/upsidedownternet.py +++ b/examples/upsidedownternet.py @@ -2,8 +2,7 @@ import Image, cStringIO def response(context, flow): if flow.response.headers["content-type"] == ["image/png"]: s = cStringIO.StringIO(flow.response.content) - img = Image.open(s) - img = img.rotate(180) + img = Image.open(s).rotate(180) s2 = cStringIO.StringIO() img.save(s2, "png") flow.response.content = s2.getvalue()