diff --git a/AUTHORS b/AUTHORS index 7157eaa9..a86e7373 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,6 +8,7 @@ Jon Maron Matthew Farrellee Nadya Privalova Nikita Konovalov +Nikolay Mahotkin Ruslan Kamaldinov Sergey Lukjanov Sergey Reshetnyak diff --git a/savanna/middleware/auth_valid.py b/savanna/middleware/auth_valid.py index fcf696d8..4adabae9 100644 --- a/savanna/middleware/auth_valid.py +++ b/savanna/middleware/auth_valid.py @@ -47,11 +47,10 @@ class AuthValidator: path = env['PATH_INFO'] if path != '/': version, url_tenant, rest = commons.split_path(path, 3, 3, True) - if not version or not url_tenant or not rest: LOG.info("Incorrect path: %s", path) resp = ex.HTTPNotFound("Incorrect path") - resp(env, start_response) + return resp(env, start_response) if token_tenant != url_tenant: LOG.debug("Unauthorized: token tenant != requested tenant") diff --git a/savanna/openstack/commons.py b/savanna/openstack/commons.py index 21828fa1..8acc3d00 100644 --- a/savanna/openstack/commons.py +++ b/savanna/openstack/commons.py @@ -52,7 +52,7 @@ def split_path(path, minsegs=1, maxsegs=None, rest_with_last=False): count = len(segs) if (segs[0] or count < minsegs or count > maxsegs or '' in segs[1:minsegs]): - raise ValueError('Invalid path: %s' % path) + return None, None, None else: minsegs += 1 maxsegs += 1