fixed issue 1331, unkown http_x_forwarded_for, thanks Tyrone
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.4.1-alpha.2+timestamp.2013.02.13.08.40.47
|
Version 2.4.1-alpha.2+timestamp.2013.02.13.08.47.47
|
||||||
|
|||||||
+2
-3
@@ -132,9 +132,8 @@ def get_client(env):
|
|||||||
if all fails, assume '127.0.0.1' or '::1' (running locally)
|
if all fails, assume '127.0.0.1' or '::1' (running locally)
|
||||||
"""
|
"""
|
||||||
g = regex_client.search(env.get('http_x_forwarded_for', ''))
|
g = regex_client.search(env.get('http_x_forwarded_for', ''))
|
||||||
if g:
|
client = (g.group() or '').split(',')[0] if g else None
|
||||||
client = (g.group() or '').split(',')[0]
|
if client in (None, '', 'unkown'):
|
||||||
else:
|
|
||||||
g = regex_client.search(env.get('remote_addr', ''))
|
g = regex_client.search(env.get('remote_addr', ''))
|
||||||
if g:
|
if g:
|
||||||
client = g.group()
|
client = g.group()
|
||||||
|
|||||||
Reference in New Issue
Block a user