mirror of
https://github.com/moparisthebest/mailcatcher
synced 2025-03-11 06:50:12 -04:00
Fix encoding errors for other than UTF-8 emails
Always sended "Content-Type: text/html;charset=utf-8" header therefore its not worked for other than utf-8 encoded emails, showed non-ascii characters as question marks.
This commit is contained in:
parent
d7a4737532
commit
101c068ac2
@ -102,14 +102,13 @@ module MailCatcher
|
|||||||
get "/messages/:id.html" do
|
get "/messages/:id.html" do
|
||||||
id = params[:id].to_i
|
id = params[:id].to_i
|
||||||
if part = Mail.message_part_html(id)
|
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"]
|
body = part["body"]
|
||||||
|
|
||||||
# Rewrite body to link to embedded attachments served by cid
|
# Rewrite body to link to embedded attachments served by cid
|
||||||
body.gsub! /cid:([^'"> ]+)/, "#{id}/parts/\\1"
|
body.gsub! /cid:([^'"> ]+)/, "#{id}/parts/\\1"
|
||||||
|
|
||||||
content_type :html
|
|
||||||
body
|
body
|
||||||
else
|
else
|
||||||
not_found
|
not_found
|
||||||
|
Loading…
x
Reference in New Issue
Block a user