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

Method addExchange

go/bundle/encoder.go:98–110  ·  view source on GitHub ↗
(e *Exchange, offset, length int)

Source from the content-addressed store, hash-verified

96}
97
98func (is *indexSection) addExchange(e *Exchange, offset, length int) error {
99 variants := normalizeHeaderValues(e.Response.Header[http.CanonicalHeaderKey("variants")])
100 variantKey := normalizeHeaderValues(e.Response.Header[http.CanonicalHeaderKey("variant-key")])
101 ent := &indexEntry{
102 Request: e.Request,
103 Variants: variants,
104 VariantKey: variantKey,
105 Offset: uint64(offset),
106 Length: uint64(length),
107 }
108 is.es = append(is.es, ent)
109 return nil
110}
111
112func (is *indexSection) Finalize(ver version.Version) error {
113 if is.bytes != nil {

Callers 3

addExchangeFunction · 0.45

Calls 1

normalizeHeaderValuesFunction · 0.70