mirror of
https://github.com/adulau/hashlookup-server.git
synced 2024-11-21 09:37:09 +00:00
chg: [server] add auth header in pub-sub
This commit is contained in:
parent
b4c539114f
commit
9e79d8ecc7
1 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue