Commit cc13ee05 by José Padilla

Fix error when NUM_PROXIES is greater than one

parent d6d08db0
...@@ -32,7 +32,7 @@ class BaseThrottle(object): ...@@ -32,7 +32,7 @@ class BaseThrottle(object):
if num_proxies == 0 or xff is None: if num_proxies == 0 or xff is None:
return remote_addr return remote_addr
addrs = xff.split(',') addrs = xff.split(',')
client_addr = addrs[-min(num_proxies, len(xff))] client_addr = addrs[-min(num_proxies, len(addrs))]
return client_addr.strip() return client_addr.strip()
return ''.join(xff.split()) if xff else remote_addr return ''.join(xff.split()) if xff else remote_addr
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment