MCPcopy
hub / github.com/caddyserver/caddy / cloneURL

Function cloneURL

modules/caddyhttp/server.go:1165–1172  ·  view source on GitHub ↗

cloneURL makes a copy of r.URL and returns a new value that doesn't reference the original.

(from, to *url.URL)

Source from the content-addressed store, hash-verified

1163// cloneURL makes a copy of r.URL and returns a
1164// new value that doesn't reference the original.
1165func cloneURL(from, to *url.URL) {
1166 *to = *from
1167 if from.User != nil {
1168 userInfo := new(url.Userinfo)
1169 *userInfo = *from.User
1170 to.User = userInfo
1171 }
1172}
1173
1174// lengthReader is an io.ReadCloser that keeps track of the
1175// number of bytes read from the request body.

Callers 2

ServeHTTPMethod · 0.85
originalRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected