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

Method HeaderMagicBytes

go/signedexchange/version/version.go:38–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38func (v Version) HeaderMagicBytes() []byte {
39 switch v {
40 case Version1b1:
41 return []byte("sxg1-b1\x00")
42 case Version1b2:
43 return []byte("sxg1-b2\x00")
44 case Version1b3:
45 return []byte("sxg1-b3\x00")
46 default:
47 panic("not reached")
48 }
49}
50
51func (v Version) MimeType() string {
52 return fmt.Sprintf("application/signed-exchange;v=%s", v[1:])

Callers 2

WriteMethod · 0.45
FromMagicBytesFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected