From 782edbd28f115da9b1eedf8bf5e574f2d2290dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Tue, 24 Nov 2015 00:43:25 -0200 Subject: Avoid mutating the headers hash We are already filtering the keys in the assign_headers_to_message method so we can just update the filter. --- actionmailer/lib/action_mailer/base.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 5d551df83b..029229ec05 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -803,7 +803,7 @@ module ActionMailer message.charset = charset = headers[:charset] # Set configure delivery behavior - wrap_delivery_behavior!(headers.delete(:delivery_method), headers.delete(:delivery_method_options)) + wrap_delivery_behavior!(headers[:delivery_method], headers[:delivery_method_options]) assign_headers_to_message(message, headers) @@ -841,7 +841,8 @@ module ActionMailer end def assign_headers_to_message(message, headers) - assignable = headers.except(:parts_order, :content_type, :body, :template_name, :template_path) + assignable = headers.except(:parts_order, :content_type, :body, :template_name, + :template_path, :delivery_method, :delivery_method_options) assignable.each { |k, v| message[k] = v } end -- cgit v1.2.3