summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-02-13 21:22:25 +0000
committerGerrit Code Review <review@openstack.org>2012-02-13 21:22:25 +0000
commit6f2ebe058ebc68f4de490b7f7d57d50345229be4 (patch)
tree287d23cae39f97c26ec4a3226a335e290f21ee1d /nova/api
parent632789c55b505e3a6cf122329eeae6c616077eba (diff)
parent95771cf112128f5f22a6a5e2e1e0e2d251f29e53 (diff)
downloadnova-6f2ebe058ebc68f4de490b7f7d57d50345229be4.tar.gz
nova-6f2ebe058ebc68f4de490b7f7d57d50345229be4.tar.xz
nova-6f2ebe058ebc68f4de490b7f7d57d50345229be4.zip
Merge "dont show blank endpoint headers"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/auth.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/nova/api/openstack/auth.py b/nova/api/openstack/auth.py
index 8e0a71d4f..84e0b16ca 100644
--- a/nova/api/openstack/auth.py
+++ b/nova/api/openstack/auth.py
@@ -52,8 +52,6 @@ class NoAuthMiddleware(base_wsgi.Middleware):
# 2.0 auth here as well.
res.headers['X-Auth-Token'] = '%s:%s' % (user_id, project_id)
res.headers['X-Server-Management-Url'] = os_url
- res.headers['X-Storage-Url'] = ''
- res.headers['X-CDN-Management-Url'] = ''
res.content_type = 'text/plain'
res.status = '204'
return res
@@ -177,8 +175,14 @@ class AuthMiddleware(base_wsgi.Middleware):
res.headers['X-Auth-Token'] = token['token_hash']
res.headers['X-Server-Management-Url'] = \
token['server_management_url']
- res.headers['X-Storage-Url'] = token['storage_url']
- res.headers['X-CDN-Management-Url'] = token['cdn_management_url']
+
+ if token['storage_url']:
+ res.headers['X-Storage-Url'] = token['storage_url']
+
+ if token['cdn_management_url']:
+ res.headers['X-CDN-Management-Url'] = \
+ token['cdn_management_url']
+
res.content_type = 'text/plain'
res.status = '204'
LOG.debug(_("Successfully authenticated '%s'") % username)