diff options
author | Mark Longair <mhl@pobox.com> | 2013-12-02 16:11:31 +0000 |
---|---|---|
committer | Mark Longair <mhl@pobox.com> | 2013-12-03 16:14:03 +0000 |
commit | 723d6c1d73176bf723b0c4726a150b1842bedf8e (patch) | |
tree | 6f6542dc99ca3736ba34102aab344655d73c1bd2 /lib/mail_handler/mail_handler.rb | |
parent | 0fe4865455786164c95766f514b4625e6061136f (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/mail_handler/mail_handler.rb')
-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 |