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