aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShadab Zafar <dufferzafar0@gmail.com>2016-03-07 09:10:08 +0530
committerShadab Zafar <dufferzafar0@gmail.com>2016-03-11 17:57:57 +0530
commit106b296871676743b04c6418d5de596ae44c1648 (patch)
tree471b43c0ec3639f7fc609bb79ad3f49587df660f
parente74e212a7a50397c663d00cd07dd91974cd1894c (diff)
downloadmitmproxy-106b296871676743b04c6418d5de596ae44c1648.tar.gz
mitmproxy-106b296871676743b04c6418d5de596ae44c1648.tar.bz2
mitmproxy-106b296871676743b04c6418d5de596ae44c1648.zip
Update modify_form example to not use deprecated functions
-rw-r--r--examples/modify_form.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/modify_form.py b/examples/modify_form.py
index 3e9d15c0..86188781 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