cmd/sgblog-comment-add/mail.go | 8 ++++---- diff --git a/cmd/sgblog-comment-add/mail.go b/cmd/sgblog-comment-add/mail.go index 9624884e93027dfb839c8cf77d137b8b98ddbc56c01a97ec1a8b576131b438a5..206f175000623aa22e38c5971f460bc865c126fb8a3a5ac20cfd28e68fd38e29 100644 --- a/cmd/sgblog-comment-add/mail.go +++ b/cmd/sgblog-comment-add/mail.go @@ -39,10 +39,10 @@ _, params, err := mime.ParseMediaType(ct) if err != nil { return nil, err } - if c := strings.ToLower(params["charset"]); !(c == "" || - c == "utf-8" || - c == "iso-8859-1" || - c == "us-ascii") { + if c := strings.ToLower(params["charset"]); c != "" && + c != "utf-8" && + c != "iso-8859-1" && + c != "us-ascii" { return nil, errors.New("only utf-8/iso-8859-1/us-ascii charsets supported") } switch cte {