(self)
| 14 | tctx.configure(mr, map_remote=["/foo/+/three"]) |
| 15 | |
| 16 | def test_simple(self): |
| 17 | mr = mapremote.MapRemote() |
| 18 | with taddons.context(mr) as tctx: |
| 19 | tctx.configure( |
| 20 | mr, |
| 21 | map_remote=[ |
| 22 | ":example.org/images/:mitmproxy.org/img/", |
| 23 | ], |
| 24 | ) |
| 25 | f = tflow.tflow() |
| 26 | f.request.url = b"https://example.org/images/test.jpg" |
| 27 | mr.request(f) |
| 28 | assert f.request.url == "https://mitmproxy.org/img/test.jpg" |
| 29 | |
| 30 | def test_host_header(self): |
| 31 | mr = mapremote.MapRemote() |