chg: [server] add auth header in pub-sub

This commit is contained in:
Alexandre Dulaunoy 2021-10-25 21:39:38 +02:00
parent b4c539114f
commit 9e79d8ecc7
Signed by: adulau
GPG key ID: 09E2CD4944E6CBCD

View file

@ -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: