MVC-Neaf
view release on metacpan or search on metacpan
lib/MVC/Neaf/Request.pm view on Meta::CPAN
# TODO 0.30 restrict params
return bless \%args, $class;
};
# TODO 0.90 A lot of copypasted methods down here.
# Should we join them all? Maybe...
=head2 client_ip()
Returns the IP of the client.
If C<X-Forwarded-For> header is set, returns that instead.
=cut
sub client_ip {
my $self = shift;
return $self->{client_ip} ||= do {
my @fwd = $self->header_in( 'X-Forwarded-For', '.*' );
@fwd == 1 && $fwd[0] || $self->do_get_client_ip || "127.0.0.1";
};
};
=head2 http_version()
Returns version number of C<http> protocol.
=cut
( run in 0.253 second using v1.01-cache-2.11-cpan-26ccb49234f )