mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 10:07:02 +00:00
Set content-type properly on MailboxHtml handler
- Changes to upstream go.enmime help with #20 - Setting content-type is required so that browsers correclty render docs that don't include an <html> element.
This commit is contained in:
8
swaks-tests/nonmime-html.raw
Normal file
8
swaks-tests/nonmime-html.raw
Normal file
@@ -0,0 +1,8 @@
|
||||
Date: %DATE%
|
||||
To: %TO_ADDRESS%
|
||||
From: %FROM_ADDRESS%
|
||||
Subject: Swaks HTML
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/html; charset="UTF-8"
|
||||
|
||||
This is a test of <b>HTML</b> at the <i>top</i> level.
|
||||
@@ -7,7 +7,10 @@ export SWAKS_OPT_to="swaks@inbucket.local"
|
||||
swaks $* --h-Subject: "Swaks Plain Text" --body text.txt
|
||||
|
||||
# HTML test
|
||||
swaks $* --h-Subject: "Swaks HTML" --data html.raw
|
||||
swaks $* --h-Subject: "Swaks HTML" --data mime-html.raw
|
||||
|
||||
# Top level HTML test
|
||||
swaks $* --h-Subject: "Swaks Top Level HTML" --data nonmime-html.raw
|
||||
|
||||
# Attachment test
|
||||
swaks $* --h-Subject: "Swaks Attachment" --attach-type image/png --attach favicon.png --body text.txt
|
||||
|
||||
@@ -210,6 +210,7 @@ func MailboxHtml(w http.ResponseWriter, req *http.Request, ctx *Context) (err er
|
||||
return err
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "text/html")
|
||||
return RenderPartial("mailbox/_html.html", w, map[string]interface{}{
|
||||
"ctx": ctx,
|
||||
"name": name,
|
||||
|
||||
Reference in New Issue
Block a user