diff options
author | Mark Longair <mhl@pobox.com> | 2013-12-02 16:11:31 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-12-05 10:43:35 +0000 |
commit | 3a84c03bb1a4b1b6465548e4c878b67cfea35602 (patch) | |
tree | cf9afe6ffdb8a49d35c57f8874fa6c33799ce35b /lib | |
parent | 9e6a9b6a7e8866885dcedae95b88fea108118644 (diff) |
Treat any document/pdf attachment as if it were application/pdf
This is a fix for issue #1232. Richard Taylor pointed
out that some PDF attachments had the non-standard content-type
document/pdf, and that these weren't being treated as PDFs.
(Ganesh Sittampalam discovered that all of these PDFs were
generated by a Lexmark X945e, according to the PDF metadata.)
This commit adds an extra case to normalise_content_type to map
document/pdf to application/pdf.
In fact, since the upgrade of the Mail gem in ccebe3c3d6d4dc5f81
the behaviour when handling the non-standard content-type
document/pdf was much better, but this commit also means that
you get the right icon for the attachment, and can be
cherry-picked onto older versions to fix #1232.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mail_handler/mail_handler.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mail_handler/mail_handler.rb b/lib/mail_handler/mail_handler.rb index 918f91180..53033d440 100644 --- a/lib/mail_handler/mail_handler.rb +++ b/lib/mail_handler/mail_handler.rb @@ -59,7 +59,7 @@ module MailHandler end # e.g. http://www.whatdotheyknow.com/request/copy_of_current_swessex_scr_opt#incoming-9928 - if content_type == 'application/acrobat' + if content_type == 'application/acrobat' or content_type == 'document/pdf' content_type = 'application/pdf' end |