From e13d273eb1c646867485bbc1cc4afcdb930456a1 Mon Sep 17 00:00:00 2001 From: Patrick Pan Date: Tue, 24 Dec 2024 09:38:48 +1100 Subject: [PATCH] resolve comments Signed-off-by: Patrick Pan --- .../Registry/Remote/HttpResponseMessageExtensions.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/OrasProject.Oras/Registry/Remote/HttpResponseMessageExtensions.cs b/src/OrasProject.Oras/Registry/Remote/HttpResponseMessageExtensions.cs index 47e5cd7..f22dda5 100644 --- a/src/OrasProject.Oras/Registry/Remote/HttpResponseMessageExtensions.cs +++ b/src/OrasProject.Oras/Registry/Remote/HttpResponseMessageExtensions.cs @@ -26,6 +26,7 @@ namespace OrasProject.Oras.Registry.Remote; internal static class HttpResponseMessageExtensions { private const string _dockerContentDigestHeader = "Docker-Content-Digest"; + /// /// Parses the error returned by the remote registry. /// @@ -100,7 +101,7 @@ public static void VerifyContentDigest(this HttpResponseMessage response, string throw new HttpIOException(HttpRequestError.InvalidResponse, $"{response.RequestMessage!.Method} {response.RequestMessage.RequestUri}: invalid response; digest mismatch in Docker-Content-Digest: received {contentDigest} when expecting {digestStr}"); } } - + /// /// CheckOciSubjectHeader checks if the response header contains "OCI-Subject", /// repository ReferrerState is set to supported if it is present @@ -114,7 +115,7 @@ internal static void CheckOciSubjectHeader(this HttpResponseMessage response, Re // Set it to Supported when the response header contains OCI-Subject repository.ReferrersState = Referrers.ReferrersState.Supported; } - + // If the "OCI-Subject" header is NOT set, it means that either the manifest // has no subject OR the referrers API is NOT supported by the registry. // Since we don't know whether the pushed manifest has a subject or not, @@ -241,4 +242,4 @@ private static async Task CalculateDigestFromResponse(this HttpResponseM var bytes = await response.Content.ReadAsByteArrayAsync(cancellationToken).ConfigureAwait(false); return Digest.ComputeSHA256(bytes); } -} +} \ No newline at end of file