https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-09#section-4.2.10
()
| 272 | |
| 273 | // https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-09#section-4.2.10 |
| 274 | func (p *parser) parseToken() (Token, error) { |
| 275 | if p.isEmpty() { |
| 276 | return "", errors.New("structuredheader: token expected, got EOS") |
| 277 | } |
| 278 | if !isAlpha(p.input[0]) { |
| 279 | return "", fmt.Errorf("structuredheader: token expected, got '%c'", p.input[0]) |
| 280 | } |
| 281 | i := 0 |
| 282 | for i < len(p.input) && isTokenChar(p.input[i]) { |
| 283 | i++ |
| 284 | } |
| 285 | return Token(p.getString(i)), nil |
| 286 | } |
| 287 | |
| 288 | // https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-09#section-4.2.11 |
| 289 | func (p *parser) parseByteSequence() ([]byte, error) { |