~sircmpwn/aerc

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] pgp: recognize uppercase MIME signatures

impaqt
Details
Message ID
<20200521053133.596218-1-impaqt@vendek.net>
DKIM signature
pass
Download raw message
Patch: +4 -4
I got an email the other day with an "APPLICATION/PGP-SIGNATURE"
attachment that wasn't recognized because it wasn't a lowercase
"application/pgp-signature". Perhaps MIME types should be lowercased
globally upon parsing?
---
 lib/messageview.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/messageview.go b/lib/messageview.go
index 59a1af6..db0184b 100644
--- a/lib/messageview.go
+++ b/lib/messageview.go
@@ -4,6 +4,7 @@ import (
	"bytes"
	"io"
	"io/ioutil"
	"strings"

	"github.com/emersion/go-message"
	_ "github.com/emersion/go-message/charset"
@@ -34,10 +35,9 @@ type MessageView interface {
}

func usePGP(info *models.BodyStructure) bool {
	if info.MIMEType == "application" {
		if info.MIMESubType == "pgp-encrypted" ||
			info.MIMESubType == "pgp-signature" {

	if strings.ToLower(info.MIMEType) == "application" {
        subtype := strings.ToLower(info.MIMESubType)
		if subtype == "pgp-encrypted" || subtype == "pgp-signature" {
			return true
		}
	}
-- 
2.26.2
Details
Message ID
<Iq0sJDPZ52FW7OUVWnAAZ5321Eu-aoIE1kzUonmy0ldxyO9kDlQXszi8hHZRp1XSmEeDkHj6AmxcCc_e5-IBqRVxWGHLP943pXJwxnFa_YM=@emersion.fr>
In-Reply-To
<20200521053133.596218-1-impaqt@vendek.net> (view parent)
DKIM signature
pass
Download raw message
On Thursday, May 21, 2020 7:31 AM, impaqt <impaqt@vendek.net> wrote:

> +          subtype := strings.ToLower(info.MIMESubType)

This line uses spaces for indentation, but Go programs should use tabs.
Please run `go fmt ./...` before sending a patch next time :)
Review patch Export thread (mbox)