X-Forwarded-For to allow multiple IPs

Version 1.56

Bugfix
Finished

Relating to feature: https://www.directadmin.com/features.php?id=1825 it allows the client IP to be set via the X-Forwarded-For header. However, multiple values should be allowed, but DA was only checking for a single valid value, this throwing this error: X-Forwarded-from IP found (2.3.4.5). But X-Forwarded-For value is not a valid IP: 1.2.3.4, 6.7.8.9 where 1.2.3.4 is the client IP, 2.3.4.5 is the incoming proxy IP and 6.7.8.9 is the unexpected "middle" proxy IP, likely between the final proxy and the client. The fix will be for DA to strip out the extra IPs, since we're less concerned with the middle proxies used to get here.

Interested to try DirectAdmin? Get a 30-day Free Trial!