mirror of
https://github.com/jhillyerd/inbucket.git
synced 2026-05-14 17:43:49 +00:00
Migrate from pkg go.enmime to enmime
This commit is contained in:
@@ -337,7 +337,7 @@ func MailboxDownloadAttach(w http.ResponseWriter, req *http.Request, ctx *httpd.
|
||||
|
||||
w.Header().Set("Content-Type", "application/octet-stream")
|
||||
w.Header().Set("Content-Disposition", "attachment")
|
||||
if _, err := w.Write(part.Content()); err != nil {
|
||||
if _, err := io.Copy(w, part); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
@@ -387,7 +387,7 @@ func MailboxViewAttach(w http.ResponseWriter, req *http.Request, ctx *httpd.Cont
|
||||
part := body.Attachments[num]
|
||||
|
||||
w.Header().Set("Content-Type", part.ContentType())
|
||||
if _, err := w.Write(part.Content()); err != nil {
|
||||
if _, err := io.Copy(w, part); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/jhillyerd/go.enmime"
|
||||
"github.com/jhillyerd/enmime"
|
||||
"github.com/jhillyerd/inbucket/config"
|
||||
"github.com/jhillyerd/inbucket/httpd"
|
||||
"github.com/jhillyerd/inbucket/smtpd"
|
||||
@@ -64,7 +64,7 @@ func (d *InputMessageData) MockMessage() *MockMessage {
|
||||
Header: d.Header,
|
||||
}
|
||||
msg.On("ReadHeader").Return(gomsg, nil)
|
||||
body := &enmime.MIMEBody{
|
||||
body := &enmime.Envelope{
|
||||
Text: d.Text,
|
||||
HTML: d.HTML,
|
||||
}
|
||||
@@ -498,9 +498,9 @@ func (m *MockMessage) ReadHeader() (msg *mail.Message, err error) {
|
||||
return args.Get(0).(*mail.Message), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *MockMessage) ReadBody() (body *enmime.MIMEBody, err error) {
|
||||
func (m *MockMessage) ReadBody() (body *enmime.Envelope, err error) {
|
||||
args := m.Called()
|
||||
return args.Get(0).(*enmime.MIMEBody), args.Error(1)
|
||||
return args.Get(0).(*enmime.Envelope), args.Error(1)
|
||||
}
|
||||
|
||||
func (m *MockMessage) ReadRaw() (raw *string, err error) {
|
||||
|
||||
Reference in New Issue
Block a user