forked from Silverfish/proton-bridge
GODT-949: Ignore some InvalidMediaParameter errors in lite parser
This commit is contained in:
@ -29,6 +29,7 @@ import (
|
|||||||
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
"github.com/ProtonMail/gopenpgp/v2/crypto"
|
||||||
pmmime "github.com/ProtonMail/proton-bridge/pkg/mime"
|
pmmime "github.com/ProtonMail/proton-bridge/pkg/mime"
|
||||||
"github.com/emersion/go-message/textproto"
|
"github.com/emersion/go-message/textproto"
|
||||||
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func EncryptRFC822(kr *crypto.KeyRing, r io.Reader) ([]byte, error) {
|
func EncryptRFC822(kr *crypto.KeyRing, r io.Reader) ([]byte, error) {
|
||||||
@ -65,7 +66,7 @@ func writeEncryptedPart(kr *crypto.KeyRing, header *textproto.Header, r io.Reade
|
|||||||
encoded := new(bytes.Buffer)
|
encoded := new(bytes.Buffer)
|
||||||
|
|
||||||
contentType, contentParams, err := parseContentType(header.Get("Content-Type"))
|
contentType, contentParams, err := parseContentType(header.Get("Content-Type"))
|
||||||
if err != nil {
|
if err != nil && !errors.Is(err, mime.ErrInvalidMediaParameter) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user