diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-02-18 14:45:22 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-02-18 14:45:22 +1300 |
commit | a7df6e1503551bf15c35252ffe39236221bae739 (patch) | |
tree | 86b55ce06498f5ad347e8995b13a7419332240e5 /test/test_utils.py | |
parent | acdc2d00b4779a8c67107794a2bc66d66036c268 (diff) | |
download | mitmproxy-a7df6e1503551bf15c35252ffe39236221bae739.tar.gz mitmproxy-a7df6e1503551bf15c35252ffe39236221bae739.tar.bz2 mitmproxy-a7df6e1503551bf15c35252ffe39236221bae739.zip |
Refactor reverse proxying
- Retain the specification from the Host header as a Request's description.
- Expand upstream proxy specifications to include the scheme. We now say https://hostname:port
- Move the "R" revert keybinding to "v" to make room for a reverse proxy
binding that matches the command-line flag.
Diffstat (limited to 'test/test_utils.py')
-rw-r--r-- | test/test_utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index 65c76ac9..c1e6fdfe 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -200,6 +200,13 @@ class uLRUCache(libpry.AutoTree): assert len(f._cachelist_one) == 2 +class u_parse_proxy_spec(libpry.AutoTree): + def test_simple(self): + assert not utils.parse_proxy_spec("") + assert utils.parse_proxy_spec("http://foo.com:88") == ("http", "foo.com", 88) + assert utils.parse_proxy_spec("http://foo.com") == ("http", "foo.com", 80) + assert not utils.parse_proxy_spec("foo.com") + class u_parse_url(libpry.AutoTree): def test_simple(self): @@ -254,6 +261,7 @@ tests = [ udummy_cert(), uLRUCache(), u_parse_url(), + u_parse_proxy_spec(), u_parse_size(), uclean_hanging_newline() ] |