From 89cf4a208bff6f7effec507e3c532ff39fe9da1d Mon Sep 17 00:00:00 2001 From: Euan Harris Date: Thu, 3 Jul 2025 14:19:11 +0100 Subject: [PATCH] ContainerRegistry: Don't escape slashes in MIME types --- Sources/ContainerRegistry/ImageManifest+Digest.swift | 2 +- Sources/ContainerRegistry/RegistryClient.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/ContainerRegistry/ImageManifest+Digest.swift b/Sources/ContainerRegistry/ImageManifest+Digest.swift index bbd1a0f..c56f0a6 100644 --- a/Sources/ContainerRegistry/ImageManifest+Digest.swift +++ b/Sources/ContainerRegistry/ImageManifest+Digest.swift @@ -18,7 +18,7 @@ import struct Crypto.SHA256 public extension ImageManifest { var digest: String { let encoder = JSONEncoder() - encoder.outputFormatting = [.sortedKeys, .prettyPrinted] + encoder.outputFormatting = [.sortedKeys, .prettyPrinted, .withoutEscapingSlashes] encoder.dateEncodingStrategy = .iso8601 let encoded = try! encoder.encode(self) return ContainerRegistry.digest(of: encoded) diff --git a/Sources/ContainerRegistry/RegistryClient.swift b/Sources/ContainerRegistry/RegistryClient.swift index beaf60c..3ed6031 100644 --- a/Sources/ContainerRegistry/RegistryClient.swift +++ b/Sources/ContainerRegistry/RegistryClient.swift @@ -84,7 +84,7 @@ public struct RegistryClient { self.encoder = encoder } else { self.encoder = JSONEncoder() - self.encoder.outputFormatting = [.sortedKeys, .prettyPrinted] + self.encoder.outputFormatting = [.sortedKeys, .prettyPrinted, .withoutEscapingSlashes] self.encoder.dateEncodingStrategy = .iso8601 }