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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user