From aa40e99d97eebe62d174fcbbc0447c3ec979b48a Mon Sep 17 00:00:00 2001 From: filipe Date: Fri, 31 Aug 2007 02:16:00 +0000 Subject: Corrected value of remote_addr (closes: #13216) git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@580 19e92222-5c0b-0410-8929-a290d50e31e9 --- lib/mongrel.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/mongrel.rb b/lib/mongrel.rb index aac2369..ef85e97 100644 --- a/lib/mongrel.rb +++ b/lib/mongrel.rb @@ -608,7 +608,13 @@ module Mongrel if handlers params[Const::PATH_INFO] = path_info params[Const::SCRIPT_NAME] = script_name - params[Const::REMOTE_ADDR] = params[Const::HTTP_X_FORWARDED_FOR] || client.peeraddr.last + # From http://www.ietf.org/rfc/rfc3875 : + # "Script authors should be aware that the REMOTE_ADDR and REMOTE_HOST + # meta-variables (see sections 4.1.8 and 4.1.9) may not identify the + # ultimate source of the request. They identify the client for the + # immediate request to the server; that client may be a proxy, gateway, + # or other intermediary acting on behalf of the actual source client." + params[Const::REMOTE_ADDR] = client.peeraddr.last # select handlers that want more detailed request notification notifiers = handlers.select { |h| h.request_notify } -- cgit v1.2.3-24-ge0c7