aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-01-20 10:07:23 -0600
committerJoshua Peek <josh@joshpeek.com>2010-01-20 10:07:23 -0600
commit93956a18e45b6bc2127da6b71dfab53516da4593 (patch)
tree48f9bc7d410d21a5fb870ce69198339eb3e03251 /actionpack
parent87bcf1aa15f8edb4287e1916b65a2c523f765e86 (diff)
downloadrails-93956a18e45b6bc2127da6b71dfab53516da4593.tar.gz
rails-93956a18e45b6bc2127da6b71dfab53516da4593.tar.bz2
rails-93956a18e45b6bc2127da6b71dfab53516da4593.zip
Only send filtered_env for notifications
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/middleware/notifications.rb17
1 files 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