https://wpack-wg.github.io/bundled-responses/draft-ietf-wpack-bundled-responses.html#manifest-section
(sectionContents []byte)
| 321 | |
| 322 | // https://wpack-wg.github.io/bundled-responses/draft-ietf-wpack-bundled-responses.html#manifest-section |
| 323 | func parseManifestSection(sectionContents []byte) (*url.URL, error) { |
| 324 | dec := cbor.NewDecoder(bytes.NewBuffer(sectionContents)) |
| 325 | urlString, err := dec.DecodeTextString() |
| 326 | if err != nil { |
| 327 | return nil, fmt.Errorf("bundle: failed to parse manifest section: %v", err) |
| 328 | } |
| 329 | manifestURL, err := url.Parse(urlString) |
| 330 | if err != nil { |
| 331 | return nil, fmt.Errorf("bundle: failed to parse manifest URL (%s): %v", urlString, err) |
| 332 | } |
| 333 | if !manifestURL.IsAbs() || manifestURL.Fragment != "" || manifestURL.User != nil { |
| 334 | return nil, fmt.Errorf("bundle: manifest URL (%s) must be an absolute url without fragment or credentials.", urlString) |
| 335 | } |
| 336 | return manifestURL, nil |
| 337 | } |
| 338 | |
| 339 | // https://wpack-wg.github.io/bundled-responses/draft-ietf-wpack-bundled-responses.html#signatures-section |
| 340 | func parseSignaturesSection(sectionContents []byte) (*Signatures, error) { |
no test coverage detected