From f97dcf76b18c6f2745dc2aab56597c15091f3040 Mon Sep 17 00:00:00 2001 From: Elliott Wood Date: Sun, 1 Mar 2009 13:08:16 -0700 Subject: [PATCH] Removed the "charset" parameter from the Content-Type header of multipart sections of nested multipart messages. --- actionmailer/lib/action_mailer/part.rb | 5 ++++- actionmailer/test/mail_service_test.rb | 1 + 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/actionmailer/lib/action_mailer/part.rb b/actionmailer/lib/action_mailer/part.rb index 977c0b2..2bbb59c 100644 --- a/actionmailer/lib/action_mailer/part.rb +++ b/actionmailer/lib/action_mailer/part.rb @@ -88,7 +88,10 @@ module ActionMailer part.parts << prt end - part.set_content_type(real_content_type, nil, ctype_attrs) if real_content_type =~ /multipart/ + if real_content_type =~ /multipart/ + ctype_attrs.delete 'charset' + part.set_content_type(real_content_type, nil, ctype_attrs) + end end headers.each { |k,v| part[k] = v } diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index 1e04531..26ba652 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -330,6 +330,7 @@ class ActionMailerTest < Test::Unit::TestCase assert_equal "multipart/mixed", created.content_type assert_equal "multipart/alternative", created.parts.first.content_type assert_equal "bar", created.parts.first.header['foo'].to_s + assert_nil created.parts.first.charset assert_equal "text/plain", created.parts.first.parts.first.content_type assert_equal "text/html", created.parts.first.parts[1].content_type assert_equal "application/octet-stream", created.parts[1].content_type -- 1.6.0.2