Skip to content

Commit cc13ee0

Browse files
committed
Fix error when NUM_PROXIES is greater than one
1 parent d6d08db commit cc13ee0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest_framework/throttling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_ident(self, request):
3232
if num_proxies == 0 or xff is None:
3333
return remote_addr
3434
addrs = xff.split(',')
35-
client_addr = addrs[-min(num_proxies, len(xff))]
35+
client_addr = addrs[-min(num_proxies, len(addrs))]
3636
return client_addr.strip()
3737

3838
return ''.join(xff.split()) if xff else remote_addr

0 commit comments

Comments
 (0)