fix possible nil panic

This commit is contained in:
kim 2024-04-04 16:21:16 +01:00
parent 8ed1b8142c
commit 991dc5c2c7

View file

@ -121,7 +121,7 @@ func isUTF8ContentType(p []string) ([]string, bool) {
for i, part := range p {
// Only handle charset slice parts.
if part[:len(charset)] == charset {
if strings.HasPrefix(part, charset) {
// Check if is UTF-8 charset.
ok := (part == charsetUTF8)