Small IP logging fix

This commit is contained in:
Luc Didry
2014-02-15 22:59:55 +01:00
parent ed2e54c919
commit e1028f2765
+1 -1
View File
@@ -51,7 +51,7 @@ sub startup {
$self->helper(
ip => sub {
my $c = shift;
my @ip = ($c->tx->remote_address eq '127.0.0.1') ? $c->tx->req->{content}->{headers}->{headers}->{'x-forwarded-for'}->[0]->[0] : ($c->tx->remote_address);
my @ip = ($c->tx->remote_address eq '127.0.0.1' && $c->app->mode eq 'production') ? $c->tx->req->{content}->{headers}->{headers}->{'x-forwarded-for'}->[0]->[0] : ($c->tx->remote_address);
return join(',', @ip);
}
);