MCPcopy Create free account
hub / github.com/WICG/webpackage / parseKey

Method parseKey

go/signedexchange/structuredheader/parser.go:106–118  ·  view source on GitHub ↗

https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-09#section-4.2.2

()

Source from the content-addressed store, hash-verified

104
105// https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-09#section-4.2.2
106func (p *parser) parseKey() (Key, error) {
107 if p.isEmpty() {
108 return "", errors.New("structuredheader: token expected, got EOS")
109 }
110 if !isLCAlpha(p.input[0]) {
111 return "", fmt.Errorf("structuredheader: token expected, got '%c'", p.input[0])
112 }
113 i := 0
114 for i < len(p.input) && isKeyChar(p.input[i]) {
115 i++
116 }
117 return Key(p.getString(i)), nil
118}
119// https://tools.ietf.org/html/draft-ietf-httpbis-header-structure-09#section-4.2.4
120func (p *parser) parseListOfLists() (ListOfLists, error) {
121 var topList ListOfLists

Callers 2

TestParseKeyFunction · 0.95

Calls 5

isEmptyMethod · 0.95
getStringMethod · 0.95
isLCAlphaFunction · 0.85
isKeyCharFunction · 0.85
KeyTypeAlias · 0.85

Tested by 1

TestParseKeyFunction · 0.76