From 7e163157479788a740a27781bedf7f559d0cc53d Mon Sep 17 00:00:00 2001 From: thinkerou Date: Wed, 20 Jun 2018 21:31:26 +0800 Subject: [PATCH] use strings.Split instead of strings.IndexByte --- utils.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/utils.go b/utils.go index 278029d7..bf32c775 100644 --- a/utils.go +++ b/utils.go @@ -103,10 +103,7 @@ func parseAccept(acceptHeader string) []string { parts := strings.Split(acceptHeader, ",") out := make([]string, 0, len(parts)) for _, part := range parts { - if index := strings.IndexByte(part, ';'); index >= 0 { - part = part[0:index] - } - if part = strings.TrimSpace(part); part != "" { + if part = strings.TrimSpace(strings.Split(part, ";")[0]); part != "" { out = append(out, part) } }