Skip to content

Commit

Permalink
don't dispose the client
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel committed Nov 21, 2022
1 parent fdb756a commit 5209f49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Microsoft.NET.Build.Containers/Registry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public record Registry(Uri BaseUri)

public async Task<Image?> GetImageManifest(string name, string reference, string runtimeIdentifier)
{
using var client = GetClient();
var client = GetClient();
var initialManifestResponse = await GetManifest(reference);

return initialManifestResponse.Content.Headers.ContentType?.MediaType switch {
Expand All @@ -48,14 +48,14 @@ public record Registry(Uri BaseUri)
};

async Task<HttpResponseMessage> GetManifest(string reference) {
using var client = GetClient();
var client = GetClient();
var response = await client.GetAsync(new Uri(BaseUri, $"/v2/{name}/manifests/{reference}"));
response.EnsureSuccessStatusCode();
return response;
}

async Task<HttpResponseMessage> GetBlob(string digest) {
using var client = GetClient();
var client = GetClient();
var response = await client.GetAsync(new Uri(BaseUri, $"/v2/{name}/blobs/{digest}"));
response.EnsureSuccessStatusCode();
return response;
Expand Down

0 comments on commit 5209f49

Please sign in to comment.