mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Better test
This commit is contained in:
parent
e2e15df358
commit
9e3f06b7f2
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user