mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-14 19:22:32 +03:00
test(ocr): align sanitized-500 assert with HR#12 error sanitization
The test's own title ("returns a sanitized 500") describes the new
behavior mandated by HR#12 (never leak err.message in a response body).
The old regex asserted the pre-sanitization leak (`OCR request failed:
socket closed`) as expected output, which contradicted its own title
and the sanitization this task intentionally introduced in
open-sse/handlers/ocr.ts. Scoped to this single assertion only.
This commit is contained in:
@@ -183,6 +183,7 @@ test("handleOcr returns a sanitized 500 when the upstream request throws", async
|
||||
const payload = (await response.json()) as any;
|
||||
|
||||
assert.equal(response.status, 500);
|
||||
assert.match(payload.error.message, /OCR request failed: socket closed/);
|
||||
assert.ok(payload.error.message.includes("OCR request failed"));
|
||||
assert.ok(!payload.error.message.includes("socket closed"));
|
||||
assert.ok(!payload.error.message.includes("at /"));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user