diff options
| author | Nikhil Komawar <nikhil.komawar@rackspace.com> | 2012-02-06 22:56:20 +0000 |
|---|---|---|
| committer | Nikhil Komawar <nikhil.komawar@rackspace.com> | 2012-02-07 00:13:26 +0000 |
| commit | 95771cf112128f5f22a6a5e2e1e0e2d251f29e53 (patch) | |
| tree | 9327a3b7ef6ccd0ba39757d1a7f30c2fc4b166b8 /nova/api | |
| parent | d52ea46f558ef5e8d2cda238d89b420e9a5d7932 (diff) | |
dont show blank endpoint headers
fixes bug: 741972
Change-Id: I4a661a13c5baaa79ee647a6c1cedcef29a2642f6
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/auth.py | 12 |
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) |
