forked from mirror/gin
Use single line (#985)
This commit is contained in:
parent
e0fd6238d3
commit
7eb943e70a
6
utils.go
6
utils.go
|
@ -100,12 +100,10 @@ func parseAccept(acceptHeader string) []string {
|
||||||
parts := strings.Split(acceptHeader, ",")
|
parts := strings.Split(acceptHeader, ",")
|
||||||
out := make([]string, 0, len(parts))
|
out := make([]string, 0, len(parts))
|
||||||
for _, part := range parts {
|
for _, part := range parts {
|
||||||
index := strings.IndexByte(part, ';')
|
if index := strings.IndexByte(part, ';'); index >= 0 {
|
||||||
if index >= 0 {
|
|
||||||
part = part[0:index]
|
part = part[0:index]
|
||||||
}
|
}
|
||||||
part = strings.TrimSpace(part)
|
if part = strings.TrimSpace(part); len(part) > 0 {
|
||||||
if len(part) > 0 {
|
|
||||||
out = append(out, part)
|
out = append(out, part)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue