From dfe114b643702b31a4dedc7cfe5b67a798f2e6cd Mon Sep 17 00:00:00 2001 From: Réouven Assouly Date: Sat, 15 Jun 2019 12:28:03 +0200 Subject: Make part encoding checks case insensitive commands/msgview/save and commands/msgview/pipe now use case insensitive comparisons to determine if the part is encoded as base64 or quoted-printable. --- commands/msgview/save.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'commands/msgview/save.go') diff --git a/commands/msgview/save.go b/commands/msgview/save.go index b15f42d5..eff9c66f 100644 --- a/commands/msgview/save.go +++ b/commands/msgview/save.go @@ -7,6 +7,7 @@ import ( "mime/quotedprintable" "os" "path/filepath" + "strings" "time" "git.sr.ht/~sircmpwn/aerc/widgets" @@ -43,10 +44,10 @@ func Save(aerc *widgets.Aerc, args []string) error { p.Store.FetchBodyPart(p.Msg.Uid, p.Index, func(reader io.Reader) { // email parts are encoded as 7bit (plaintext), quoted-printable, or base64 - switch p.Part.Encoding { - case "base64": + + if strings.EqualFold(p.Part.Encoding, "base64") { reader = base64.NewDecoder(base64.StdEncoding, reader) - case "quoted-printable": + } else if strings.EqualFold(p.Part.Encoding, "quoted-printable") { reader = quotedprintable.NewReader(reader) } -- cgit