Skip to content

Commit cd64747

Browse files
committed
ContainerRegistry: Tolerate missing Content-Type header in registry response
1 parent bb85677 commit cd64747

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

Sources/ContainerRegistry/HTTPClient.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,6 @@ extension URLSession: HTTPClient {
8181
}
8282
}
8383

84-
// Content-Type should always be set, but there may be registries which don't set it. If it is not present, the HTTP standard allows
85-
// clients to guess the content type, or default to `application/octet-stream'.
86-
guard let _ = response.headerFields[.contentType] else {
87-
throw HTTPClientError.missingResponseHeader("Content-Type")
88-
}
89-
9084
// A HEAD request has no response body and cannot be decoded
9185
if request.method == .head {
9286
throw HTTPClientError.unexpectedStatusCode(status: response.status, response: response, data: nil)

0 commit comments

Comments
 (0)