aboutsummaryrefslogtreecommitdiffstats
path: root/examples/modify_form.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/modify_form.py')
-rw-r--r--examples/modify_form.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/modify_form.py b/examples/modify_form.py
index c2f0a47e..3e9d15c0 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["content-type"]:
+ if "application/x-www-form-urlencoded" in flow.request.headers.get("content-type", ""):
form = flow.request.get_form_urlencoded()
form["mitmproxy"] = ["rocks"]
flow.request.set_form_urlencoded(form)