Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/publish-catalog.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export async function inspectArchive(spec, archivePath, zipUtils, sequence) {
verifyPePlatform(worker.data, spec, spec.id);
return {
manifest,
archive_url: (spec.artifact.url_template ?? spec.artifact.url).replace("{sequence}", String(sequence)),
archive_url: `https://github.com/makekosmos/package-index/releases/download/catalog-${sequence}/${spec.artifact.name}`,
sha256: hash(bytes),
size: bytes.length,
};
Expand Down
3 changes: 2 additions & 1 deletion scripts/publish-catalog.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ test("archive policy rejects traversal, collisions, and extra files", async () =
{ name: "icon.png", data: Buffer.from("icon") },
{ name: "manifest.json", data: JSON.stringify(completeManifest(appSpec)) },
]);
await assert.doesNotReject(() => inspectArchive(appSpec, app, { readZip }, 8));
const inspectedApp = await inspectArchive(appSpec, app, { readZip }, 8);
assert.equal(inspectedApp.archive_url, "https://github.com/makekosmos/package-index/releases/download/catalog-8/app.kspkg");
const extra = path.join(dir, "extra.kspkg");
await writeArchive(extra, spec, [{ name: "payload.exe", data: peFixture() }]);
await assert.rejects(() => inspectArchive(spec, extra, { readZip }, 8), /unexpected/);
Expand Down
Loading