From 9e79d8ecc7641cb65dec5f2bc2ad4a4426d6d4c1 Mon Sep 17 00:00:00 2001 From: Alexandre Dulaunoy Date: Mon, 25 Oct 2021 21:39:38 +0200 Subject: [PATCH] chg: [server] add auth header in pub-sub --- bin/server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/server.py b/bin/server.py index a3d91d4..c41d925 100644 --- a/bin/server.py +++ b/bin/server.py @@ -48,7 +48,11 @@ def client_info(): else: ip = request.environ['HTTP_X_FORWARDED_FOR'] user_agent = request.headers.get('User-Agent') - return ({'ip_addr': ip, 'user_agent': user_agent}) + if request.environ.get('HTTP_AUTHENTICATION') is not None: + auth = request.environ.get('HTTP_AUTHORIZATION') + else: + auth = None + return ({'ip_addr': ip, 'user_agent': user_agent, 'auth': auth}) def pub_lookup(channel=None, k=None): if channel is None: