]> git.cworth.org Git - sup/commitdiff
case-insensitive content-type detection
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Sat, 19 Jan 2008 17:25:20 +0000 (09:25 -0800)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Sat, 19 Jan 2008 17:25:20 +0000 (09:25 -0800)
Apparently some mailers uppercase their shit. E.g.:
Content-type: text/plain; Format=Flowed; Charset=iso-8859-1

lib/sup/util.rb

index 47bc1c21402a6c8a06f6f54d46c6e0440caa47f8..ceaf0b8dabc8a83ea451005e9b27bc109823caf1 100644 (file)
@@ -62,7 +62,7 @@ module RMail
     end
 
     def charset
-      if header.field?("content-type") && header.fetch("content-type") =~ /charset="?(.*?)"?(;|$)/
+      if header.field?("content-type") && header.fetch("content-type") =~ /charset="?(.*?)"?(;|$)/i
         $1
       end
     end