lemonwaysas/php-client-directkit-xml

Issue with multiple IPS in HTTP_X_FORWARDED_FOR

jeanlamy opened this issue · 1 comments

Hi,

When using this library behind a proxy or a LB (like CloudFront and ELB), 2 IP's are sent to Lemonway API.
This is due to the fact that HTTP_X_FORWARDED_FOR contains 2 IP's.

I've made a quick fix by just adding code to LemonWayApi.php:791 :
// check if there is multiple ips
$ips = explode(',', $ip);
if (count($ips) > 0) {
$ip = $ips[0];
}

Do you have any better idea? Do you want me to create a pull request? (I will need to read Github docs as this may be my first pull request!

Best regards

Jean

Thank you, it was fixed