MCPcopy Create free account
hub / github.com/prometheus/common / cloneRequest

Function cloneRequest

config/http_config.go:1239–1246  ·  view source on GitHub ↗

cloneRequest returns a clone of the provided *http.Request. The clone is a shallow copy of the struct and its Header map.

(r *http.Request)

Source from the content-addressed store, hash-verified

1237// cloneRequest returns a clone of the provided *http.Request.
1238// The clone is a shallow copy of the struct and its Header map.
1239func cloneRequest(r *http.Request) *http.Request {
1240 // Shallow copy of the struct.
1241 r2 := new(http.Request)
1242 *r2 = *r
1243 // Deep copy of the Header.
1244 maps.Copy(r.Header, r2.Header)
1245 return r2
1246}
1247
1248type tlsConfigOptions struct {
1249 secretManager SecretManager

Callers 6

RoundTripMethod · 0.85
RoundTripMethod · 0.85
RoundTripMethod · 0.85
RoundTripMethod · 0.85
RoundTripMethod · 0.85
RoundTripMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected