mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-05-06 17:03:42 +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:
|
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user