| 35 | assert list(f.request.urlencoded_form.items()) == [("foo", "bar")] |
| 36 | |
| 37 | def test_modify_querystring(self, tdata): |
| 38 | with taddons.context() as tctx: |
| 39 | sc = tctx.script( |
| 40 | tdata.path("../examples/addons/http-modify-query-string.py") |
| 41 | ) |
| 42 | f = tflow.tflow(req=tutils.treq(path="/search?q=term")) |
| 43 | |
| 44 | sc.request(f) |
| 45 | assert f.request.query["mitmproxy"] == "rocks" |
| 46 | |
| 47 | f.request.path = "/" |
| 48 | sc.request(f) |
| 49 | assert f.request.query["mitmproxy"] == "rocks" |
| 50 | |
| 51 | def test_redirect_requests(self, tdata): |
| 52 | with taddons.context() as tctx: |