aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAmmonite <pierre@ambox.fr>2017-01-31 23:23:13 +0100
committerAmmonite <pierre@ambox.fr>2017-01-31 23:23:13 +0100
commit9e3f06b7f27da778c730bbf912e3f1709ed9f058 (patch)
tree2139d5a27cbfb8de7fb3e02e4238fddca2894a9e /test
parente2e15df3581fb5fa77769b3ebbb23e5f5cd0a5ca (diff)
downloadmitmproxy-9e3f06b7f27da778c730bbf912e3f1709ed9f058.tar.gz
mitmproxy-9e3f06b7f27da778c730bbf912e3f1709ed9f058.tar.bz2
mitmproxy-9e3f06b7f27da778c730bbf912e3f1709ed9f058.zip
Better test
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_examples.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/mitmproxy/test_examples.py b/test/mitmproxy/test_examples.py
index 25712d2d..e32323a6 100644
--- a/test/mitmproxy/test_examples.py
+++ b/test/mitmproxy/test_examples.py
@@ -108,15 +108,21 @@ class TestScripts(mastertest.MasterTest):
original_host = "example.com"
host_header = Headers(host=original_host)
- f = tflow.tflow(req=tutils.treq(headers=host_header))
+ f = tflow.tflow(req=tutils.treq(headers=host_header, port=80))
m.requestheaders(f)
# Rewrite by reverse proxy mode
+ f.request.scheme = "https"
f.request.host = "mitmproxy.org"
+ f.request.port = 443
m.request(f)
+
+ assert f.request.scheme == "http"
assert f.request.host == original_host
+ assert f.request.port == 80
+
assert f.request.headers["Host"] == original_host