MCPcopy
hub / github.com/containerd/containerd / request

Method request

core/remotes/docker/resolver.go:533–559  ·  view source on GitHub ↗
(host RegistryHost, method string, ps ...string)

Source from the content-addressed store, hash-verified

531}
532
533func (r *dockerBase) request(host RegistryHost, method string, ps ...string) *request {
534 header := r.header.Clone()
535 if header == nil {
536 header = http.Header{}
537 }
538
539 for key, value := range host.Header {
540 header[key] = append(header[key], value...)
541 }
542
543 if len(header.Get("User-Agent")) == 0 {
544 header.Set("User-Agent", "containerd/"+version.Version)
545 }
546
547 parts := append([]string{"/", host.Path, r.repository}, ps...)
548 p := path.Join(parts...)
549 // Join strips trailing slash, re-add ending "/" if included
550 if len(parts) > 0 && strings.HasSuffix(parts[len(parts)-1], "/") {
551 p = p + "/"
552 }
553 return &request{
554 method: method,
555 path: p,
556 header: header,
557 host: host,
558 }
559}
560
561func (r *request) authorize(ctx context.Context, req *http.Request) error {
562 // Check if has header for host

Callers 12

openReferrersMethod · 0.80
FetchMethod · 0.80
createGetReqMethod · 0.80
FuzzFetcherFunction · 0.80
TestFetcherOpenFunction · 0.80
TestFetcherOpenParallelFunction · 0.80
TestContentEncodingFunction · 0.80
TestDockerFetcherOpenFunction · 0.80
pushMethod · 0.80
ResolveMethod · 0.80

Calls 2

GetMethod · 0.65
SetMethod · 0.65

Tested by 7

FuzzFetcherFunction · 0.64
TestFetcherOpenFunction · 0.64
TestFetcherOpenParallelFunction · 0.64
TestContentEncodingFunction · 0.64
TestDockerFetcherOpenFunction · 0.64