plugins/base: disallow replying to text/html parts

This commit is contained in:
Simon Ser 2020-03-18 15:08:36 +01:00
parent ae8658f468
commit be3ab9bdd5
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

View file

@ -494,7 +494,7 @@ func handleReply(ctx *koushin.Context) error {
return fmt.Errorf("failed to parse part Content-Type: %v", err) 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) err := fmt.Errorf("cannot reply to %q part", mimeType)
return echo.NewHTTPError(http.StatusBadRequest, err) return echo.NewHTTPError(http.StatusBadRequest, err)
} }