From 23223157d04c7638f14fead657670b247e6c7e3f Mon Sep 17 00:00:00 2001 From: Massimo Di Pierro Date: Sat, 31 Dec 2011 12:28:17 -0600 Subject: [PATCH] web2py sitting behind load balancer showing lb IP not client IP, thanks Dave Stoll --- VERSION | 2 +- gluon/globals.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index f8062071..72b693c1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 1.99.4 (2011-12-31 12:03:17) stable +Version 1.99.4 (2011-12-31 12:28:04) stable diff --git a/gluon/globals.py b/gluon/globals.py index e61223ee..9a9f08b2 100644 --- a/gluon/globals.py +++ b/gluon/globals.py @@ -551,7 +551,7 @@ class Session(Storage): (record_id_name, table, record_id, unique_key) = \ response._dbtable_and_field - dd = dict(locked=False, client_ip=request.env.remote_addr, + dd = dict(locked=False, client_ip=request.client.replace(':','.'), modified_datetime=request.now, session_data=cPickle.dumps(dict(self)), unique_key=unique_key)