Subject: | Warning when REMOTE_ADDR is undef |
Date: | Sun, 27 Mar 2016 23:21:51 +0200 |
To: | bug-Catalyst-Runtime [...] rt.cpan.org |
From: | Mauritz Hansen <mauritzhansen [...] yapedi.com> |
Hi folks,
I log all warnings generated by my app, and my logfile is filled with the following warning:
WARNING: Use of uninitialized value in string eq at /usr/local/share/perl/5.18.2/Catalyst.pm line 2960.
REMOTE_ADDR may be empty, and this is not checked for. I have created the following patch (version 5.90103):
@@ -3421,7 +3421,7 @@
condition => sub {
my ($env) = @_;
return if $app->config->{ignore_frontend_proxy};
- return $env->{REMOTE_ADDR} eq '127.0.0.1';
+ return $env->{REMOTE_ADDR} && ($env->{REMOTE_ADDR} eq '127.0.0.1');
},
);
}
Regards,
Mauritz