MCPcopy
hub / github.com/willnorris/imageproxy / copyHeader

Function copyHeader

imageproxy.go:360–367  ·  view source on GitHub ↗

copyHeader copies values for specified headers from src to dst, adding to any existing values with the same header name.

(dst, src http.Header, headerNames ...string)

Source from the content-addressed store, hash-verified

358// copyHeader copies values for specified headers from src to dst, adding to
359// any existing values with the same header name.
360func copyHeader(dst, src http.Header, headerNames ...string) {
361 for _, name := range headerNames {
362 k := http.CanonicalHeaderKey(name)
363 for _, v := range src[k] {
364 dst.Add(k, v)
365 }
366 }
367}
368
369var (
370 errReferrer = errors.New("request does not contain an allowed referrer")

Callers 2

TestCopyHeaderFunction · 0.85
serveImageMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestCopyHeaderFunction · 0.68