From 610842cda582a543a7cc6eb5040f9fb31befdb76 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 2 Apr 2016 21:15:55 +0200 Subject: [PATCH] fix FlowMaster.create_request, add test --- mitmproxy/flow.py | 1 + test/mitmproxy/test_flow.py | 5 +++++ 2 files changed, 6 insertions(+) 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)