From 93956a18e45b6bc2127da6b71dfab53516da4593 Mon Sep 17 00:00:00 2001
From: Joshua Peek <josh@joshpeek.com>
Date: Wed, 20 Jan 2010 10:07:23 -0600
Subject: Only send filtered_env for notifications

---
 .../lib/action_dispatch/middleware/notifications.rb     | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/actionpack/lib/action_dispatch/middleware/notifications.rb b/actionpack/lib/action_dispatch/middleware/notifications.rb
index c3776d53a8..ce3732b740 100644
--- a/actionpack/lib/action_dispatch/middleware/notifications.rb
+++ b/actionpack/lib/action_dispatch/middleware/notifications.rb
@@ -9,7 +9,9 @@ module ActionDispatch
     end
 
     def call(env)
-      payload = retrieve_payload_from_env(env)
+      request = Request.new(env)
+      payload = retrieve_payload_from_env(request.filter_env)
+
       ActiveSupport::Notifications.instrument("action_dispatch.before_dispatch", payload)
 
       ActiveSupport::Notifications.instrument!("action_dispatch.after_dispatch", payload) do
@@ -21,11 +23,10 @@ module ActionDispatch
       raise exception
     end
 
-  protected
-
-    # Remove any rack related constants from the env, like rack.input.
-    def retrieve_payload_from_env(env)
-      Hash[:env => env.except(*env.keys.select { |k| k.to_s.index("rack.") == 0 })]
-    end
+    protected
+      # Remove any rack related constants from the env, like rack.input.
+      def retrieve_payload_from_env(env)
+        Hash[:env => env.except(*env.keys.select { |k| k.to_s.index("rack.") == 0 })]
+      end
   end
-end
\ No newline at end of file
+end
-- 
cgit v1.2.3