diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-05 20:45:58 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-05 20:45:58 +0200 |
commit | 5125c669ccd2db5de5f90c66db61e64f63f3ba4c (patch) | |
tree | 6773ffcaada096f7e02c54665b733c1bad350e98 /examples/stickycookies | |
parent | 00561d280ccd4aac06b13b434e0aef4492148cb5 (diff) | |
download | mitmproxy-5125c669ccd2db5de5f90c66db61e64f63f3ba4c.tar.gz mitmproxy-5125c669ccd2db5de5f90c66db61e64f63f3ba4c.tar.bz2 mitmproxy-5125c669ccd2db5de5f90c66db61e64f63f3ba4c.zip |
adjust to new netlib Headers class
Diffstat (limited to 'examples/stickycookies')
-rwxr-xr-x | examples/stickycookies | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/stickycookies b/examples/stickycookies index 67b31da1..7e84f71c 100755 --- a/examples/stickycookies +++ b/examples/stickycookies @@ -23,16 +23,16 @@ class StickyMaster(controller.Master): def handle_request(self, flow): hid = (flow.request.host, flow.request.port) - if flow.request.headers["cookie"]: - self.stickyhosts[hid] = flow.request.headers["cookie"] + if "cookie" in flow.request.headers: + self.stickyhosts[hid] = flow.request.headers.get_all("cookie") elif hid in self.stickyhosts: - flow.request.headers["cookie"] = self.stickyhosts[hid] + flow.request.headers.set_all("cookie", self.stickyhosts[hid]) flow.reply() def handle_response(self, flow): hid = (flow.request.host, flow.request.port) - if flow.response.headers["set-cookie"]: - self.stickyhosts[hid] = flow.response.headers["set-cookie"] + if "set-cookie" in flow.response.headers: + self.stickyhosts[hid] = flow.response.headers.get_all("set-cookie") flow.reply() |