| 21 | assert "tEST!" in result |
| 22 | |
| 23 | def test_modify_form(self, tdata): |
| 24 | with taddons.context() as tctx: |
| 25 | sc = tctx.script(tdata.path("../examples/addons/http-modify-form.py")) |
| 26 | |
| 27 | form_header = Headers(content_type="application/x-www-form-urlencoded") |
| 28 | f = tflow.tflow(req=tutils.treq(headers=form_header)) |
| 29 | sc.request(f) |
| 30 | |
| 31 | assert f.request.urlencoded_form["mitmproxy"] == "rocks" |
| 32 | |
| 33 | f.request.headers["content-type"] = "" |
| 34 | sc.request(f) |
| 35 | assert list(f.request.urlencoded_form.items()) == [("foo", "bar")] |
| 36 | |
| 37 | def test_modify_querystring(self, tdata): |
| 38 | with taddons.context() as tctx: |