aboutsummaryrefslogtreecommitdiffstats
path: root/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 /netlib
parent01f52ee56ab6b798aed3f8cec35ba9b3a25cbd87 (diff)
downloadmitmproxy-9d47d3b1ecaed6db1d143a56973e931140ad1949.tar.gz
mitmproxy-9d47d3b1ecaed6db1d143a56973e931140ad1949.tar.bz2
mitmproxy-9d47d3b1ecaed6db1d143a56973e931140ad1949.zip
fix #1120
Diffstat (limited to 'netlib')
-rw-r--r--netlib/http/request.py2
-rw-r--r--netlib/utils.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/netlib/http/request.py b/netlib/http/request.py
index 6406a980..67aa17ce 100644
--- a/netlib/http/request.py
+++ b/netlib/http/request.py
@@ -162,7 +162,7 @@ class Request(Message):
def path(self):
"""
HTTP request path, e.g. "/index.html".
- Guaranteed to start with a slash.
+ Guaranteed to start with a slash, except for OPTIONS requests, which may just be "*".
"""
if self.data.path is None:
return None
diff --git a/netlib/utils.py b/netlib/utils.py
index dda76808..ebd192f3 100644
--- a/netlib/utils.py
+++ b/netlib/utils.py
@@ -330,6 +330,8 @@ def unparse_url(scheme, host, port, path=""):
Args:
All args must be str.
"""
+ if path == "*":
+ path = ""
return "%s://%s%s" % (scheme, hostport(scheme, host, port), path)