feat: add PDF magic bytes validation, 410 Gone, and manual extraction tests (refs #144)

Add filename .pdf extension fallback and %PDF magic bytes validation to
extractManual controller. Update getJobStatus to return 410 Gone for
expired jobs. Add 16 unit tests covering all acceptance criteria.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Eric Gullickson
2026-02-11 14:55:06 -06:00
parent 209425a908
commit ca33f8ad9d
3 changed files with 110 additions and 9 deletions

View File

@@ -368,8 +368,8 @@ export class OcrService {
return result;
} catch (error) {
if (error instanceof JobNotFoundError) {
const err: any = new Error(`Job ${jobId} not found. Jobs expire after 1 hour.`);
err.statusCode = 404;
const err: any = new Error('Job expired (max 2 hours). Please resubmit.');
err.statusCode = 410;
throw err;
}