mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 10:07:02 +00:00
go.enmime API now uses HTML instead of Html
This commit is contained in:
@@ -115,7 +115,7 @@ func MailboxShowV1(w http.ResponseWriter, req *http.Request, ctx *httpd.Context)
|
|||||||
Header: header.Header,
|
Header: header.Header,
|
||||||
Body: &JSONMessageBodyV1{
|
Body: &JSONMessageBodyV1{
|
||||||
Text: mime.Text,
|
Text: mime.Text,
|
||||||
HTML: mime.Html,
|
HTML: mime.HTML,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ func (d *InputMessageData) MockMessage() *MockMessage {
|
|||||||
msg.On("ReadHeader").Return(gomsg, nil)
|
msg.On("ReadHeader").Return(gomsg, nil)
|
||||||
body := &enmime.MIMEBody{
|
body := &enmime.MIMEBody{
|
||||||
Text: d.Text,
|
Text: d.Text,
|
||||||
Html: d.HTML,
|
HTML: d.HTML,
|
||||||
}
|
}
|
||||||
msg.On("ReadBody").Return(body, nil)
|
msg.On("ReadBody").Return(body, nil)
|
||||||
return msg
|
return msg
|
||||||
|
|||||||
@@ -171,13 +171,13 @@ func MailboxShow(w http.ResponseWriter, req *http.Request, ctx *httpd.Context) (
|
|||||||
Header: header.Header,
|
Header: header.Header,
|
||||||
Body: &JSONMessageBody{
|
Body: &JSONMessageBody{
|
||||||
Text: mime.Text,
|
Text: mime.Text,
|
||||||
HTML: mime.Html,
|
HTML: mime.HTML,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
body := template.HTML(httpd.TextToHTML(mime.Text))
|
body := template.HTML(httpd.TextToHTML(mime.Text))
|
||||||
htmlAvailable := mime.Html != ""
|
htmlAvailable := mime.HTML != ""
|
||||||
|
|
||||||
return httpd.RenderPartial("mailbox/_show.html", w, map[string]interface{}{
|
return httpd.RenderPartial("mailbox/_show.html", w, map[string]interface{}{
|
||||||
"ctx": ctx,
|
"ctx": ctx,
|
||||||
@@ -252,7 +252,7 @@ func MailboxHTML(w http.ResponseWriter, req *http.Request, ctx *httpd.Context) (
|
|||||||
"name": name,
|
"name": name,
|
||||||
"message": message,
|
"message": message,
|
||||||
// TODO: It is not really safe to render, need to sanitize.
|
// TODO: It is not really safe to render, need to sanitize.
|
||||||
"body": template.HTML(mime.Html),
|
"body": template.HTML(mime.HTML),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ func (d *InputMessageData) MockMessage() *MockMessage {
|
|||||||
msg.On("ReadHeader").Return(gomsg, nil)
|
msg.On("ReadHeader").Return(gomsg, nil)
|
||||||
body := &enmime.MIMEBody{
|
body := &enmime.MIMEBody{
|
||||||
Text: d.Text,
|
Text: d.Text,
|
||||||
Html: d.HTML,
|
HTML: d.HTML,
|
||||||
}
|
}
|
||||||
msg.On("ReadBody").Return(body, nil)
|
msg.On("ReadBody").Return(body, nil)
|
||||||
return msg
|
return msg
|
||||||
|
|||||||
Reference in New Issue
Block a user