diff options
author | 2024-04-04 16:45:59 +0100 | |
---|---|---|
committer | 2024-04-04 16:45:59 +0100 | |
commit | 83e7847cdff157233d20a1841dd0c5092ff9b81c (patch) | |
tree | 6cf9e4f2580a627ff41b446fd78d7a2f81b4725e /internal/api | |
parent | [chore] Log less output on failed test (#2804) (diff) | |
download | gotosocial-83e7847cdff157233d20a1841dd0c5092ff9b81c.tar.xz |
fix possible nil panic (#2809)
Diffstat (limited to 'internal/api')
-rw-r--r-- | internal/api/util/mime.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/api/util/mime.go b/internal/api/util/mime.go index 1e183d8e0..8dcbfc28c 100644 --- a/internal/api/util/mime.go +++ b/internal/api/util/mime.go @@ -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) |