From 9daafd84f3eba464080a40818ff673944d4e4ca7 Mon Sep 17 00:00:00 2001 From: Deepinder Setia Date: Tue, 13 Dec 2016 15:55:08 -0800 Subject: [PATCH] I think start_response must called inside pseudo-app to keep WSGI gods happy. Start_response wasn't getting called prior to this fix if user token was invalid. Change-Id: I84b0f6790cfd9f2c479f81951974bd5e51ba2fd1 Closes-Bug: #1648274 --- src/config/api-server/vnc_auth_keystone.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config/api-server/vnc_auth_keystone.py b/src/config/api-server/vnc_auth_keystone.py index 9697c82e2a5..59efc81d0a3 100644 --- a/src/config/api-server/vnc_auth_keystone.py +++ b/src/config/api-server/vnc_auth_keystone.py @@ -263,6 +263,7 @@ def get_auth_headers_from_token(self, request, token): conf_info['delay_auth_decision'] = True def token_to_headers(env, start_response): + start_response('200 OK', [('Content-type', 'text/plain')]) status = env.get('HTTP_X_IDENTITY_STATUS') if status and status.lower() == 'invalid': return {} @@ -273,7 +274,6 @@ def token_to_headers(env, start_response): hdr_val = env.get(hdr_name) if hdr_val: ret_headers_dict[hdr_name] = hdr_val - start_response('200 OK', [('Content-type', 'text/plain')]) return ret_headers_dict auth_middleware = auth_token.AuthProtocol(token_to_headers, conf_info)