From e1028f2765f09cfc94d4cf53bb49cca750c54f43 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Sat, 15 Feb 2014 22:59:55 +0100 Subject: [PATCH] Small IP logging fix --- lib/Lutim.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Lutim.pm b/lib/Lutim.pm index 3a95fb0..073cc63 100644 --- a/lib/Lutim.pm +++ b/lib/Lutim.pm @@ -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); } );