diff --git a/mitmproxy/flow.py b/mitmproxy/flow.py index fbf102b51..781ea1502 100644 --- a/mitmproxy/flow.py +++ b/mitmproxy/flow.py @@ -845,6 +845,7 @@ class FlowMaster(controller.Master): s = ServerConnection.from_state(dict( address=dict(address=(host, port), use_ipv6=False), + peer_address=None, cert=None, sni=host, source_address=dict(address=('', 0), use_ipv6=False), diff --git a/test/mitmproxy/test_flow.py b/test/mitmproxy/test_flow.py index 2353935bf..926564a2a 100644 --- a/test/mitmproxy/test_flow.py +++ b/test/mitmproxy/test_flow.py @@ -809,6 +809,11 @@ class TestFlowMaster: assert s.flow_count() == 2 assert s.index(f2) == 1 + def test_create_flow(self): + s = flow.State() + fm = flow.FlowMaster(None, s) + assert fm.create_request("GET", "http", "example.com", 80, "/") + def test_all(self): s = flow.State() fm = flow.FlowMaster(None, s)