mirror of
https://github.com/moparisthebest/mailcatcher
synced 2024-11-12 04:05:01 -05:00
Refactor to refernce parts by sub-path
This commit is contained in:
parent
c3a3bb1880
commit
63432c27c8
@ -67,7 +67,7 @@ module MailCatcher
|
||||
body = part["body"]
|
||||
|
||||
# Rewrite body to link to embedded attachments served by cid
|
||||
body.gsub! /cid:([^'"> ]+)/, "#{id}/\\1"
|
||||
body.gsub! /cid:([^'"> ]+)/, "#{id}/parts/\\1"
|
||||
|
||||
# Rewrite body to open links in a new window
|
||||
body.gsub! /<a\s+/, '<a target="_blank" '
|
||||
@ -108,7 +108,7 @@ module MailCatcher
|
||||
end
|
||||
end
|
||||
|
||||
get "/messages/:id/:cid" do
|
||||
get "/messages/:id/parts/:cid" do
|
||||
id = params[:id].to_i
|
||||
if part = MailCatcher::Mail.message_part_cid(id, params[:cid])
|
||||
content_type part["type"], :charset => (part["charset"] || "utf8")
|
||||
|
Loading…
Reference in New Issue
Block a user