From 5ab6a9e7b790e6282068c79094d915f8194df3ee Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Sun, 28 Feb 2016 18:48:18 -0500 Subject: [PATCH] Provide client hook to get session info Web client may come in without knowing the session info. Provide it additional data to populate UI elements. --- confluent_server/confluent/httpapi.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/confluent_server/confluent/httpapi.py b/confluent_server/confluent/httpapi.py index 8356c250..a385d12f 100644 --- a/confluent_server/confluent/httpapi.py +++ b/confluent_server/confluent/httpapi.py @@ -468,6 +468,10 @@ def resourcehandler_backend(env, start_response): url = env['PATH_INFO'] url = url.replace('.json', '') url = url.replace('.html', '') + if url == '/sessions/current/info': + start_response('200 OK', headers) + yield json.dumps({'username': authorized['username']}) + return resource = '.' + url[url.rindex('/'):] lquerydict = copy.deepcopy(querydict) try: