Gantry::Utils::PerlbalFixup - This module will set the client ip


Gantry documentation Contained in the Gantry distribution.

Index


Code Index:

NAME

Top

Gantry::Utils::PerlbalFixup - This module will set the client ip

SYNOPSIS

Top

 #httpd.conf or some such
 #can be any Perl*Handler
 PerlInitHandler Gantry::Utils::PerlbalFixup

DESCRIPTION

Top

This module will set the proper client ip using the X-Forwarded-For header which is set by Perlbal and other proxy methods. This module should be loaded at the PerlInitHandler or PerlReadParseHeaders phase during the request life- cycle

METHODS

Top

handler

The apache fixup handler. Stores the value of the X-Forwarded-For header in the remote_ip of the request's connection, so apps behind a perlbal proxy can tell who their client is.

SEE ALSO

Top

mod_perl(3)

AUTHOR

Top

Tim Keefer <tkeefer@gmail.com>


Gantry documentation Contained in the Gantry distribution.

package Gantry::Utils::PerlbalFixup;

use strict;

sub handler {
    my $r = shift;

    $r->connection->remote_ip( $r->header_in('X-Forwarded-For') )
        if $r->header_in('X-Forwarded-For') ne "";

    return 1;
}
1;