mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 15:46:44 +00:00
GODT-213: Preserve contenttype for undecryptable message body
This commit is contained in:
@ -48,8 +48,7 @@ func writeCustomTextPart(
|
|||||||
|
|
||||||
var hdr message.Header
|
var hdr message.Header
|
||||||
|
|
||||||
// Even if it is HTML, we don't care... we abuse pgp/inline here.
|
hdr.SetContentType(msg.MIMEType, nil)
|
||||||
hdr.SetContentType("text/plain", nil)
|
|
||||||
|
|
||||||
part, err := w.CreatePart(hdr)
|
part, err := w.CreatePart(hdr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -1001,9 +1001,8 @@ func TestBuildCustomMessageHTML(t *testing.T) {
|
|||||||
section(t, res).
|
section(t, res).
|
||||||
expectContentType(is(`multipart/mixed`))
|
expectContentType(is(`multipart/mixed`))
|
||||||
|
|
||||||
// Even if it is HTML, we don't care... we abuse pgp/inline here.
|
|
||||||
section(t, res, 1).
|
section(t, res, 1).
|
||||||
expectContentType(is(`text/plain`)).
|
expectContentType(is(`text/html`)).
|
||||||
expectBody(contains(`This message could not be decrypted`)).
|
expectBody(contains(`This message could not be decrypted`)).
|
||||||
expectBody(decryptsTo(foreignKR, `<html><body>body</body></html>`)).
|
expectBody(decryptsTo(foreignKR, `<html><body>body</body></html>`)).
|
||||||
expectTransferEncoding(isMissing())
|
expectTransferEncoding(isMissing())
|
||||||
@ -1076,9 +1075,8 @@ func TestBuildCustomMessageHTMLWithAttachment(t *testing.T) {
|
|||||||
section(t, res).
|
section(t, res).
|
||||||
expectContentType(is(`multipart/mixed`))
|
expectContentType(is(`multipart/mixed`))
|
||||||
|
|
||||||
// Even if it is HTML, we don't care... we abuse pgp/inline here.
|
|
||||||
section(t, res, 1).
|
section(t, res, 1).
|
||||||
expectContentType(is(`text/plain`)).
|
expectContentType(is(`text/html`)).
|
||||||
expectBody(contains(`This message could not be decrypted`)).
|
expectBody(contains(`This message could not be decrypted`)).
|
||||||
expectBody(decryptsTo(foreignKR, `<html><body>body</body></html>`)).
|
expectBody(decryptsTo(foreignKR, `<html><body>body</body></html>`)).
|
||||||
expectTransferEncoding(isMissing())
|
expectTransferEncoding(isMissing())
|
||||||
@ -1120,9 +1118,8 @@ func TestBuildCustomMessageOnlyBodyIsUndecryptable(t *testing.T) {
|
|||||||
section(t, res).
|
section(t, res).
|
||||||
expectContentType(is(`multipart/mixed`))
|
expectContentType(is(`multipart/mixed`))
|
||||||
|
|
||||||
// Even if it is HTML, we don't care... we abuse pgp/inline here.
|
|
||||||
section(t, res, 1).
|
section(t, res, 1).
|
||||||
expectContentType(is(`text/plain`)).
|
expectContentType(is(`text/html`)).
|
||||||
expectBody(contains(`This message could not be decrypted`)).
|
expectBody(contains(`This message could not be decrypted`)).
|
||||||
expectBody(decryptsTo(foreignKR, `<html><body>body</body></html>`)).
|
expectBody(decryptsTo(foreignKR, `<html><body>body</body></html>`)).
|
||||||
expectTransferEncoding(isMissing())
|
expectTransferEncoding(isMissing())
|
||||||
|
|||||||
Reference in New Issue
Block a user