From 106b296871676743b04c6418d5de596ae44c1648 Mon Sep 17 00:00:00 2001 From: Shadab Zafar Date: Mon, 7 Mar 2016 09:10:08 +0530 Subject: [PATCH] Update modify_form example to not use deprecated functions --- examples/modify_form.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/modify_form.py b/examples/modify_form.py index 3e9d15c00..86188781b 100644 --- a/examples/modify_form.py +++ b/examples/modify_form.py @@ -1,5 +1,5 @@ def request(context, flow): - if "application/x-www-form-urlencoded" in flow.request.headers.get("content-type", ""): - form = flow.request.get_form_urlencoded() + form = flow.request.urlencoded_form + if form is not None: form["mitmproxy"] = ["rocks"] - flow.request.set_form_urlencoded(form) + flow.request.urlencoded_form = form