[Jifty-commit] jifty-plugin-accesslog branch, master, updated. d376c6e50d10bfe3ee857ac70a84065f77d83fdc

Jifty commits jifty-commit at lists.jifty.org
Mon May 3 14:17:55 EDT 2010


The branch, master has been updated
       via  d376c6e50d10bfe3ee857ac70a84065f77d83fdc (commit)
      from  2334cd74caedfec115507290e31eefc7312d38c8 (commit)

Summary of changes:
 lib/Jifty/Plugin/AccessLog.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit d376c6e50d10bfe3ee857ac70a84065f77d83fdc
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon May 3 14:18:07 2010 -0400

    Respect the X-Forwarded-For header when reporting requesting IP

diff --git a/lib/Jifty/Plugin/AccessLog.pm b/lib/Jifty/Plugin/AccessLog.pm
index 7e2ea00..1840e40 100644
--- a/lib/Jifty/Plugin/AccessLog.pm
+++ b/lib/Jifty/Plugin/AccessLog.pm
@@ -210,7 +210,7 @@ sub before_cleanup {
         C => sub { my $c = { CGI::Cookie->fetch() }->{+shift}; $c ? $c->value : undef },
         D => sub { sprintf "%.3fms", (Time::HiRes::time - $self->start)*1000 },
         e => sub { $ENV{+shift} },
-        h => sub { $r->remote_host || $r->address },
+        h => sub { $r->header("X-Forwarded-For") || $r->remote_host || $r->address },
         i => sub { $r->header(shift) },
         l => sub { substr( Jifty->web->session->id || '-', 0, 8 ) },
         m => sub { $r->method },

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list