fix(artifacts): compare package signatures without ASCII folding (#2069)
This commit is contained in:
@@ -299,7 +299,7 @@ const detectArtifactFormat = async (
|
||||
if (
|
||||
lower.endsWith(".pkg") &&
|
||||
observed.bytesRead >= 4 &&
|
||||
magic.subarray(0, 4).toString("ascii") === "xar!"
|
||||
magic.subarray(0, 4).equals(Buffer.from("xar!"))
|
||||
)
|
||||
return "pkg";
|
||||
if (lower.endsWith(".dmg")) {
|
||||
@@ -310,7 +310,7 @@ const detectArtifactFormat = async (
|
||||
const trailer = Buffer.alloc(4);
|
||||
const read = await handle.read(trailer, 0, trailer.length, size - 512);
|
||||
throwIfTargetResolutionCancelled(signal);
|
||||
if (read.bytesRead === 4 && trailer.toString("ascii") === "koly")
|
||||
if (read.bytesRead === 4 && trailer.equals(Buffer.from("koly")))
|
||||
return "dmg";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user