mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-04-09 22:14:49 +00:00
GET /api/attachments/:id crashes with "Cannot read properties of undefined (reading extension)" when the S3 object has no ContentType metadata. This happens when files are uploaded without explicit content type (e.g., via API integrations). mime.extension(undefined) returns undefined, which then causes the Content-Disposition header template to fail. Fix: fallback to "application/octet-stream" when ContentType is missing, and "bin" when mime.extension() returns undefined. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>