Skip to content

Commit 63e03a5

Browse files
authored
ContainerRegistry: Don't escape slashes in MIME types (#143)
Motivation ---------- _[Explain here the context, and why you're making that change. What is the problem you're trying to solve.]_ Modifications ------------- _[Describe the modifications you've made.]_ Result ------ _[After your change, what will change.]_ Test Plan --------- _[Describe the steps you took, or will take, to qualify the change - such as adjusting tests and manual testing.]_
1 parent 931db31 commit 63e03a5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/ContainerRegistry/ImageManifest+Digest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import struct Crypto.SHA256
1818
public extension ImageManifest {
1919
var digest: String {
2020
let encoder = JSONEncoder()
21-
encoder.outputFormatting = [.sortedKeys, .prettyPrinted]
21+
encoder.outputFormatting = [.sortedKeys, .prettyPrinted, .withoutEscapingSlashes]
2222
encoder.dateEncodingStrategy = .iso8601
2323
let encoded = try! encoder.encode(self)
2424
return ContainerRegistry.digest(of: encoded)

Sources/ContainerRegistry/RegistryClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public struct RegistryClient {
8484
self.encoder = encoder
8585
} else {
8686
self.encoder = JSONEncoder()
87-
self.encoder.outputFormatting = [.sortedKeys, .prettyPrinted]
87+
self.encoder.outputFormatting = [.sortedKeys, .prettyPrinted, .withoutEscapingSlashes]
8888
self.encoder.dateEncodingStrategy = .iso8601
8989
}
9090

0 commit comments

Comments
 (0)