MCPcopy Create free account
hub / github.com/imgproxy/imgproxy / Copy

Function Copy

httpheaders/copy.go:8–15  ·  view source on GitHub ↗

Copy copies specified headers from one header to another.

(from, to http.Header, only []string)

Source from the content-addressed store, hash-verified

6
7// Copy copies specified headers from one header to another.
8func Copy(from, to http.Header, only []string) {
9 for _, key := range only {
10 key = http.CanonicalHeaderKey(key)
11 if values := from[key]; len(values) > 0 {
12 to[key] = append([]string(nil), values...)
13 }
14 }
15}
16
17// CopyAll copies all headers from one header to another.
18func CopyAll(from, to http.Header, overwrite bool) {

Callers 4

TestCopyFunction · 0.92
NewObjectNotModifiedFunction · 0.92
PassthroughMethod · 0.92
CopyFromMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestCopyFunction · 0.74