mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 09:36:49 +03:00
Fix error when NUM_PROXIES is greater than one
This commit is contained in:
parent
d6d08db0dd
commit
cc13ee0577
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user