Merge "Support <scheme>://<netloc>/<prefix> endpoints"
This commit is contained in:
commit
4a4443dcab
@ -35,7 +35,8 @@ def parse_url(filt, url):
|
||||
path = result.path
|
||||
vstr = VERSION_PATTERN.search(path)
|
||||
if not vstr:
|
||||
return result.scheme + "://" + result.netloc + "/" + filt.get_path()
|
||||
return (result.scheme + "://" + result.netloc + path.rstrip('/') +
|
||||
'/' + filt.get_path())
|
||||
start, end = vstr.span()
|
||||
prefix = path[:start]
|
||||
version = '/' + filt.get_path(path[start + 1:end])
|
||||
|
@ -27,6 +27,9 @@ class TestSession(testtools.TestCase):
|
||||
self.assertEqual(
|
||||
"http://127.0.0.1:9292/v1",
|
||||
session.parse_url(filt, "http://127.0.0.1:9292"))
|
||||
self.assertEqual(
|
||||
"http://127.0.0.1:9292/foo/v1",
|
||||
session.parse_url(filt, "http://127.0.0.1:9292/foo"))
|
||||
self.assertEqual(
|
||||
"http://127.0.0.1:9292/v2",
|
||||
session.parse_url(filt, "http://127.0.0.1:9292/v2.0"))
|
||||
|
Loading…
Reference in New Issue
Block a user