fix: make OCR portable and reliable across AMD64 and ARM64 (#519)

* fix: make OCR portable and reliable

* fix: harden OCR installation portability

* fix: pin OCR partials across downloads

* fix: make OCR execution reliably asynchronous

* fix: harden OCR portability and docs routes

* fix: preserve decoder and docs safeguards
This commit is contained in:
SnapOtter
2026-07-15 03:34:24 +08:00
committed by GitHub
parent 58121f205f
commit 991c981529
409 changed files with 67151 additions and 8076 deletions
+14
View File
@@ -128,4 +128,18 @@ describe("multipartParts", () => {
await generator.return(undefined);
});
it("honors a route-specific two-file limit", async () => {
const body = multipartBody([
{ name: "index", filename: "ocr-runtime-index.json", content: "index" },
{ name: "archive", filename: "ocr-runtime.tar.gz", content: "archive" },
{ name: "extra", filename: "extra.bin", content: "unexpected" },
]);
await expect(async () => {
for await (const part of multipartParts(fakeRequest(body), { files: 2 })) {
if (part.type === "file") await drain(part.file);
}
}).rejects.toThrow("files limit");
});
});