code: func checkRegistryStatus(statusCode int, hdr http.Header, version registryVersion) (bool, error) {
  	switch statusCode {
  	case http.StatusOK, http.StatusUnauthorized:
  		ok := true
  		if version == registryV2 {
  			// According to v2 spec, registries SHOULD set this header value
  			// and clients MAY fallback to v1 if missing, as done here.
  			ok = hdr.Get("Docker-Distribution-API-Version") == "registry/2.0"
  		}
  		return ok, nil
  	}
  	return false, nil
  }
docs: // checkRegistryStatus determines registry API version compatibility according to spec:
  // https://docs.docker.com/registry/spec/api/#/api-version-check