aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Wood <elliott@two-fish.com>2009-03-01 13:08:16 -0700
committerMichael Koziarski <michael@koziarski.com>2009-03-02 18:51:30 +1300
commitc41ed929bbbe649c730a90e1f3bf8a1f88dc1f81 (patch)
treea9e9e8f81f473764948514991c882e99a704c563
parent38136f86dc5504bde94dc7399d4a854023d7481f (diff)
downloadrails-c41ed929bbbe649c730a90e1f3bf8a1f88dc1f81.tar.gz
rails-c41ed929bbbe649c730a90e1f3bf8a1f88dc1f81.tar.bz2
rails-c41ed929bbbe649c730a90e1f3bf8a1f88dc1f81.zip
Removed the "charset" parameter from the Content-Type header of multipart sections of nested multipart messages.
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#2109 state:committed]
-rw-r--r--actionmailer/lib/action_mailer/part.rb5
-rw-r--r--actionmailer/test/mail_service_test.rb1
2 files changed, 5 insertions, 1 deletions
diff --git a/actionmailer/lib/action_mailer/part.rb b/actionmailer/lib/action_mailer/part.rb
index 977c0b2b5c..2bbb59cdb6 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 1e04531753..26ba652f2a 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