MCPcopy
hub / github.com/esm-dev/esm.sh / appendVaryHeader

Function appendVaryHeader

server/utils.go:169–176  ·  view source on GitHub ↗

appendVaryHeader appends the given key to the `Vary` header.

(header http.Header, key string)

Source from the content-addressed store, hash-verified

167
168// appendVaryHeader appends the given key to the `Vary` header.
169func appendVaryHeader(header http.Header, key string) {
170 vary := header.Get("Vary")
171 if vary == "" {
172 header.Set("Vary", key)
173 } else {
174 header.Set("Vary", vary+", "+key)
175 }
176}
177
178// concatBytes concatenates two byte slices.
179func concatBytes(a, b []byte) []byte {

Callers 3

corsFunction · 0.85
esmRouterFunction · 0.85
legacyESMFunction · 0.85

Calls 2

SetMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected