We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 898150e commit 3dc7f92Copy full SHA for 3dc7f92
src/acceptHeaders/accepts.go
@@ -34,6 +34,10 @@ func (accepts Accepts) GetPreferredValue(availables []string) (index int, value
34
func ParseAccepts(input string) Accepts {
35
entries := strings.Split(input, ",")
36
entryCount := len(entries)
37
+ if entryCount == 0 {
38
+ return nil
39
+ }
40
+
41
accepts := make(Accepts, entryCount)
42
for i := 0; i < entryCount; i++ {
43
accepts[i] = parseAcceptItem(strings.TrimSpace(entries[i]))
0 commit comments