tokenListContainsValue returns true if the 1#token header with the given name contains a token equal to value with ASCII case folding.
(header http.Header, name string, value string)
| 200 | // tokenListContainsValue returns true if the 1#token header with the given |
| 201 | // name contains a token equal to value with ASCII case folding. |
| 202 | func tokenListContainsValue(header http.Header, name string, value string) bool { |
| 203 | headers: |
| 204 | for _, s := range header[name] { |
| 205 | for { |
| 206 | var t string |
| 207 | t, s = nextToken(skipSpace(s)) |
| 208 | if t == "" { |
| 209 | continue headers |
| 210 | } |
| 211 | s = skipSpace(s) |
| 212 | if s != "" && s[0] != ',' { |
| 213 | continue headers |
| 214 | } |
| 215 | if equalASCIIFold(t, value) { |
| 216 | return true |
| 217 | } |
| 218 | if s == "" { |
| 219 | continue headers |
| 220 | } |
| 221 | s = s[1:] |
| 222 | } |
| 223 | } |
| 224 | return false |
| 225 | } |
| 226 | |
| 227 | // parseExtensions parses WebSocket extensions from a header. |
| 228 | func parseExtensions(header http.Header) []map[string]string { |
searching dependent graphs…