From 2c5c1276a84692ba58f60c8ff5fdad744959b69a Mon Sep 17 00:00:00 2001 From: Gareth du Plooy Date: Tue, 8 Mar 2016 22:18:49 -0500 Subject: Pass headers through to payload for logging. Make request headers available in the event payload so that it is available to attached ActionController::LogSubscribers. --- actionpack/test/controller/log_subscriber_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack/test/controller/log_subscriber_test.rb') diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index 6ae33be3c8..57cf2dafdf 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -183,6 +183,12 @@ class ACLogSubscriberTest < ActionController::TestCase assert_equal "test_value", @controller.last_payload[:test_key] end + def test_process_action_headers + get :show + wait + assert_equal "Rails Testing", @controller.last_payload[:headers]['User-Agent'] + end + def test_process_action_with_filter_parameters @request.env["action_dispatch.parameter_filter"] = [:lifo, :amount] -- cgit v1.2.3