diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-09-08 16:02:31 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-09-08 17:03:34 +0200 |
commit | ebd539b49f0706918e979dc921cf454ae448eaf9 (patch) | |
tree | 1c541027c735e18c7486d5d9ebda7367278ac244 /examples/iframe_injector.py | |
parent | d06b4bfa4e4cc51e903b49e246d7771726a3e3a4 (diff) | |
download | mitmproxy-ebd539b49f0706918e979dc921cf454ae448eaf9.tar.gz mitmproxy-ebd539b49f0706918e979dc921cf454ae448eaf9.tar.bz2 mitmproxy-ebd539b49f0706918e979dc921cf454ae448eaf9.zip |
update examples, fix #353
Diffstat (limited to 'examples/iframe_injector.py')
-rw-r--r-- | examples/iframe_injector.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/iframe_injector.py b/examples/iframe_injector.py index 7042dbab..42260a7e 100644 --- a/examples/iframe_injector.py +++ b/examples/iframe_injector.py @@ -3,16 +3,16 @@ from libmproxy.protocol.http import decoded -def start(ctx, argv): +def start(context, argv): if len(argv) != 2: raise ValueError('Usage: -s "iframe_injector.py url"') - ctx.iframe_url = argv[1] + context.iframe_url = argv[1] -def handle_response(ctx, flow): +def handle_response(context, flow): with decoded(flow.response): # Remove content encoding (gzip, ...) c = flow.response.replace( '<body>', - '<body><iframe src="%s" frameborder="0" height="0" width="0"></iframe>' % ctx.iframe_url) + '<body><iframe src="%s" frameborder="0" height="0" width="0"></iframe>' % context.iframe_url) if c > 0: - ctx.log("Iframe injected!")
\ No newline at end of file + context.log("Iframe injected!")
\ No newline at end of file |