aboutsummaryrefslogtreecommitdiffstats
path: root/test/netlib
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-05-09 12:15:20 -0600
committerMaximilian Hils <git@maximilianhils.com>2016-05-09 12:15:20 -0600
commit9d47d3b1ecaed6db1d143a56973e931140ad1949 (patch)
treef3d49c2939f47a3ca197e1a947ae91d571f18bc8 /test/netlib
parent01f52ee56ab6b798aed3f8cec35ba9b3a25cbd87 (diff)
downloadmitmproxy-9d47d3b1ecaed6db1d143a56973e931140ad1949.tar.gz
mitmproxy-9d47d3b1ecaed6db1d143a56973e931140ad1949.tar.bz2
mitmproxy-9d47d3b1ecaed6db1d143a56973e931140ad1949.zip
fix #1120
Diffstat (limited to 'test/netlib')
-rw-r--r--test/netlib/http/test_request.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/netlib/http/test_request.py b/test/netlib/http/test_request.py
index 50ad2d05..91fd8ce3 100644
--- a/test/netlib/http/test_request.py
+++ b/test/netlib/http/test_request.py
@@ -107,6 +107,14 @@ class TestRequestUtils(object):
with raises(ValueError):
request.url = "not-a-url"
+ def test_url_options(self):
+ request = treq(method="OPTIONS", path="*")
+ assert request.url == "http://address:22"
+
+ def test_url_authority(self):
+ request = treq(first_line_format="authority")
+ assert request.url == "address:22"
+
def test_pretty_host(self):
request = treq()
# Without host header
@@ -140,6 +148,10 @@ class TestRequestUtils(object):
request.headers["host"] = "other"
assert request.pretty_url == "http://address:22/path"
+ def test_pretty_url_options(self):
+ request = treq(method="OPTIONS", path="*")
+ assert request.pretty_url == "http://address:22"
+
def test_pretty_url_authority(self):
request = treq(first_line_format="authority")
assert request.pretty_url == "address:22"