From be3ab9bdd5fed219e31767d51150d9da14f03280 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Wed, 18 Mar 2020 15:08:36 +0100 Subject: [PATCH] plugins/base: disallow replying to text/html parts --- plugins/base/routes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/base/routes.go b/plugins/base/routes.go index 85034de..c24d3bb 100644 --- a/plugins/base/routes.go +++ b/plugins/base/routes.go @@ -494,7 +494,7 @@ func handleReply(ctx *koushin.Context) error { return fmt.Errorf("failed to parse part Content-Type: %v", err) } - if !strings.HasPrefix(strings.ToLower(mimeType), "text/") { + if !strings.EqualFold(mimeType, "text/plain") { err := fmt.Errorf("cannot reply to %q part", mimeType) return echo.NewHTTPError(http.StatusBadRequest, err) }