mirror of
https://github.com/moparisthebest/mailcatcher
synced 2024-12-22 07:18:53 -05:00
Merge pull request #221 from csiszarattila/master
Fix encoding errors for other than UTF-8 emails
This commit is contained in:
commit
bc86e995ef
@ -102,14 +102,13 @@ module MailCatcher
|
||||
get "/messages/:id.html" do
|
||||
id = params[:id].to_i
|
||||
if part = Mail.message_part_html(id)
|
||||
content_type part["type"], :charset => (part["charset"] || "utf8")
|
||||
content_type :html, :charset => (part["charset"] || "utf8")
|
||||
|
||||
body = part["body"]
|
||||
|
||||
# Rewrite body to link to embedded attachments served by cid
|
||||
body.gsub! /cid:([^'"> ]+)/, "#{id}/parts/\\1"
|
||||
|
||||
content_type :html
|
||||
body
|
||||
else
|
||||
not_found
|
||||
|
Loading…
Reference in New Issue
Block a user