MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_host_header

Method test_host_header

test/mitmproxy/addons/test_mapremote.py:30–38  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 assert f.request.url == "https://mitmproxy.org/img/test.jpg"
29
30 def test_host_header(self):
31 mr = mapremote.MapRemote()
32 with taddons.context(mr) as tctx:
33 tctx.configure(mr, map_remote=["|http://[^/]+|http://example.com:4444"])
34 f = tflow.tflow()
35 f.request.url = b"http://example.org/example"
36 f.request.headers["Host"] = "example.org"
37 mr.request(f)
38 assert f.request.headers.get("Host", "") == "example.com:4444"
39
40 def test_is_killed(self):
41 mr = mapremote.MapRemote()

Callers

nothing calls this directly

Calls 4

requestMethod · 0.95
contextMethod · 0.80
configureMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected