diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-05-29 12:54:52 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-05-29 12:54:52 +1200 |
commit | 0176f50e4f4994be4b19be212f3a3db053a18d0c (patch) | |
tree | 5b02f270425f1d6d59b0844a2555cbdcfdcda82a /examples/stickycookies | |
parent | 0a875421c53ac992026f653c7b9944ba83d8ec3f (diff) | |
download | mitmproxy-0176f50e4f4994be4b19be212f3a3db053a18d0c.tar.gz mitmproxy-0176f50e4f4994be4b19be212f3a3db053a18d0c.tar.bz2 mitmproxy-0176f50e4f4994be4b19be212f3a3db053a18d0c.zip |
Adapt examples
Diffstat (limited to 'examples/stickycookies')
-rwxr-xr-x[-rw-r--r--] | examples/stickycookies | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/stickycookies b/examples/stickycookies index 8f11de8d..43e5371d 100644..100755 --- a/examples/stickycookies +++ b/examples/stickycookies @@ -21,19 +21,19 @@ class StickyMaster(controller.Master): except KeyboardInterrupt: self.shutdown() - def handle_request(self, flow): + @controller.handler + def request(self, flow): hid = (flow.request.host, flow.request.port) if "cookie" in flow.request.headers: self.stickyhosts[hid] = flow.request.headers.get_all("cookie") elif hid in self.stickyhosts: flow.request.headers.set_all("cookie", self.stickyhosts[hid]) - flow.reply() - def handle_response(self, flow): + @controller.handler + def response(self, flow): hid = (flow.request.host, flow.request.port) if "set-cookie" in flow.response.headers: self.stickyhosts[hid] = flow.response.headers.get_all("set-cookie") - flow.reply() config = proxy.ProxyConfig(port=8080) |