Fix auth issue when accessing root path "/"

Now when access the root path of Zaqar service, for example:
curl GET http://127.0.0.1:8888/, user will see 401 error. Which
will cause some front end proxy(like HAProxy) complain. This
patch fixes the issue.

Closes-Bug: #1569474

Change-Id: I92c98495bf26277cd4c8c1d019c54698cace4bbd
This commit is contained in:
Fei Long Wang 2016-04-13 06:54:10 +12:00
parent e78c257d07
commit b59c304f7c

View File

@ -32,6 +32,11 @@ class SignedHeadersAuth(object):
def __call__(self, environ, start_response):
path = environ.get('PATH_INFO')
# NOTE(flwang): The root path of Zaqar service shouldn't require any
# auth.
if path == '/':
return self._app(environ, start_response)
signature = environ.get('HTTP_URL_SIGNATURE')
if signature is None or path.startswith('/v1'):