diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-11-24 00:43:25 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-11-24 00:43:25 -0200 |
commit | 782edbd28f115da9b1eedf8bf5e574f2d2290dae (patch) | |
tree | 8cd47deb87ce09f9df3e8de5c31dd6d299d2f1a7 /actionmailer | |
parent | c6368db90ff021211eae7fd49f20f59e2a83b193 (diff) | |
download | rails-782edbd28f115da9b1eedf8bf5e574f2d2290dae.tar.gz rails-782edbd28f115da9b1eedf8bf5e574f2d2290dae.tar.bz2 rails-782edbd28f115da9b1eedf8bf5e574f2d2290dae.zip |
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.
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 5 |
1 files changed, 3 insertions, 2 deletions
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 |