Update modify_form example to not use deprecated functions

This commit is contained in:
Shadab Zafar 2016-03-07 09:10:08 +05:30
parent e74e212a7a
commit 106b296871

View File

@ -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