MCPcopy
hub / github.com/gin-gonic/gin / parseAccept

Function parseAccept

utils.go:110–122  ·  view source on GitHub ↗
(acceptHeader string)

Source from the content-addressed store, hash-verified

108}
109
110func parseAccept(acceptHeader string) []string {
111 parts := strings.Split(acceptHeader, ",")
112 out := make([]string, 0, len(parts))
113 for _, part := range parts {
114 if i := strings.IndexByte(part, ';'); i > 0 {
115 part = part[:i]
116 }
117 if part = strings.TrimSpace(part); part != "" {
118 out = append(out, part)
119 }
120 }
121 return out
122}
123
124func lastChar(str string) uint8 {
125 if str == "" {

Callers 3

BenchmarkParseAcceptFunction · 0.85
TestParseAcceptFunction · 0.85
NegotiateFormatMethod · 0.85

Calls

no outgoing calls

Tested by 2

BenchmarkParseAcceptFunction · 0.68
TestParseAcceptFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…