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)
| 1237 | // cloneRequest returns a clone of the provided *http.Request. |
| 1238 | // The clone is a shallow copy of the struct and its Header map. |
| 1239 | func 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 | |
| 1248 | type tlsConfigOptions struct { |
| 1249 | secretManager SecretManager |