https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-09#section-4.2.4
()
| 118 | } |
| 119 | // https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-09#section-4.2.4 |
| 120 | func (p *parser) parseListOfLists() (ListOfLists, error) { |
| 121 | var topList ListOfLists |
| 122 | var innerList []Item |
| 123 | for !p.isEmpty() { |
| 124 | item, err := p.parseItem() |
| 125 | if err != nil { |
| 126 | return nil, err |
| 127 | } |
| 128 | innerList = append(innerList, item) |
| 129 | p.discardLeadingOWS() |
| 130 | if p.isEmpty() { |
| 131 | topList = append(topList, innerList) |
| 132 | return topList, nil |
| 133 | } |
| 134 | if p.consumeChar(',') { |
| 135 | topList = append(topList, innerList) |
| 136 | innerList = nil |
| 137 | } else if !p.consumeChar(';') { |
| 138 | return nil, fmt.Errorf("structuredheader: ',' or ';' expected, got '%c'", p.input[0]) |
| 139 | } |
| 140 | p.discardLeadingOWS() |
| 141 | } |
| 142 | return nil, errors.New("structuredheader: unexpected end of input; List of Lists expected") |
| 143 | } |
| 144 | |
| 145 | // https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-09#section-4.2.5 |
| 146 | func (p *parser) parseParameterisedList() (ParameterisedList, error) { |
no test coverage detected