feat: allow application/octet-stream MIME type for PDF uploads in receipt import

This commit is contained in:
Nils-Johan Gynther
2026-04-30 13:38:23 +02:00
parent cee62397fc
commit 046791b63e
@@ -84,7 +84,10 @@ export class ReceiptImportService {
); );
} }
const isPdf = file.mimetype === 'application/pdf'; const isPdf =
file.mimetype === 'application/pdf' ||
file.mimetype === 'application/octet-stream' ||
file.originalname?.toLowerCase().endsWith('.pdf');
const rawItems = isPdf const rawItems = isPdf
? await this.parseReceiptFromPdf(file.buffer, apiKey) ? await this.parseReceiptFromPdf(file.buffer, apiKey)
: await this.parseReceiptFromImage(file.buffer, file.mimetype, apiKey); : await this.parseReceiptFromImage(file.buffer, file.mimetype, apiKey);