Commit e480f655 authored by David Lawrence's avatar David Lawrence

Bug 1294571 - 015remote_ip.t throws a "uninitialized value" warning

parent 74cc5335
......@@ -291,7 +291,7 @@ sub remote_ip {
my @x_forwarded_for = split(/[\s,]+/, $ENV{HTTP_X_FORWARDED_FOR} // '');
return $remote_ip unless @x_forwarded_for;
return $x_forwarded_for[0] if $proxies[0] eq '*';
return $x_forwarded_for[0] if (@proxies && $proxies[0] eq '*');
return $remote_ip if none { $_ eq $remote_ip } @proxies;
foreach my $ip (reverse @x_forwarded_for) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment