File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Sources/ContainerRegistry Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -16,15 +16,17 @@ public extension RegistryClient {
1616 /// Returns a boolean value indicating whether the registry supports v2 of the distribution specification.
1717 /// - Returns: `true` if the registry supports the distribution specification, otherwise `false`.
1818 func checkAPI( ) async throws -> Bool {
19- // The registry indicates that it supports the v2 protocol by returning an empty JSON object i.e. {}.
20- // The registry may require authentication on this endpoint.
2119 // See https://github.com/opencontainers/distribution-spec/blob/main/spec.md#determining-support
20+ // The registry indicates that it supports the v2 protocol by returning a 200 OK response.
21+ // Many registries also set `Content-Type: application/json` and return empty JSON objects,
22+ // but this is not required and some do not.
23+ // The registry may require authentication on this endpoint.
2224 do {
23- return try await executeRequestThrowing (
25+ let _ = try await executeRequestThrowing (
2426 . get( registryURLForPath ( " /v2/ " ) ) ,
2527 decodingErrors: [ . unauthorized, . notFound]
2628 )
27- . data == EmptyObject ( )
29+ return true
2830 } catch HTTPClientError . unexpectedStatusCode( status: . notFound, _, _) { return false }
2931 }
3032}
You can’t perform that action at this time.
0 commit comments