BUG: Upload POST /part uses upload.single('file') but nginx strips Content-Type for multipart — multer may misparse #74

Closed
opened 2026-05-25 06:22:07 -04:00 by zgaetano · 1 comment
Owner

Fixed — services/web-ui/nginx.conf now sets proxy_set_header Content-Type $content_type in the /api/ block so multer receives the full multipart boundary. Verified in current main.

Fixed — `services/web-ui/nginx.conf` now sets `proxy_set_header Content-Type $content_type` in the `/api/` block so multer receives the full multipart boundary. Verified in current `main`.
Author
Owner

Fix Plan — #74 nginx strips Content-Type for multipart uploads

Root cause: Multer's memoryStorage needs original Content-Type: multipart/form-data; boundary=... header. If nginx normalizes headers, multer fails with MulterError: Unexpected field.

Fix:

  1. Add to nginx config:
proxy_set_header Content-Type $content_type;
  1. Configure multer with explicit limits:
multer({
  storage: multer.memoryStorage(),
  limits: { fileSize: 500 * 1024 * 1024, files: 1 }
})

Files: nginx.conf, src/routes/upload.js
Effort: ~30min
**Priority: P2 — upload reliability

## Fix Plan — #74 nginx strips Content-Type for multipart uploads **Root cause:** Multer's memoryStorage needs original Content-Type: multipart/form-data; boundary=... header. If nginx normalizes headers, multer fails with MulterError: Unexpected field. **Fix:** 1. Add to nginx config: ```nginx proxy_set_header Content-Type $content_type; ``` 2. Configure multer with explicit limits: ```js multer({ storage: multer.memoryStorage(), limits: { fileSize: 500 * 1024 * 1024, files: 1 } }) ``` **Files:** nginx.conf, src/routes/upload.js **Effort:** ~30min **Priority: P2 — upload reliability
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: WildDragonLLC/dragonflight#74
No description provided.