Skip to content

Commit

Permalink
I think start_response must called inside pseudo-app to keep WSGI
Browse files Browse the repository at this point in the history
gods happy. Start_response wasn't getting called prior to this fix
if user token was invalid.

Change-Id: I84b0f6790cfd9f2c479f81951974bd5e51ba2fd1
Closes-Bug: #1648274
  • Loading branch information
Deepinder Setia committed Dec 14, 2016
1 parent 23f7275 commit 9daafd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/config/api-server/vnc_auth_keystone.py
Expand Up @@ -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 {}
Expand All @@ -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)
Expand Down

0 comments on commit 9daafd8

Please sign in to comment.