Fix error when NUM_PROXIES is greater than one

This commit is contained in:
José Padilla 2015-01-12 08:12:24 -04:00
parent d6d08db0dd
commit cc13ee0577

View File

@ -32,7 +32,7 @@ class BaseThrottle(object):
if num_proxies == 0 or xff is None:
return remote_addr
addrs = xff.split(',')
client_addr = addrs[-min(num_proxies, len(xff))]
client_addr = addrs[-min(num_proxies, len(addrs))]
return client_addr.strip()
return ''.join(xff.split()) if xff else remote_addr