fix-require-agent-header
🐛 Bug Fixes
Require Bcyip-Agent to create a file or a document
Goal: The IP Magic Box still creates files and documents on the legacy API. A request with no agent header must not create either.
Solution: Return 400 when Bcyip-Agent is missing or blank on POST /api/documents and POST /api/files/upload/ (main API and the big-file upload API). Any non-empty header value is accepted. fileId checks are unchanged.
Features:
- Missing or blank
Bcyip-Agent→ 400 before the file or document is created - No exception for
iptower - Header value is not checked against
agent_codes
Files Modified:
app/util/documentIngest.js- Shared header guardapp/routes/documents.js- Guard document createapp/routes/files.js- GuardPOST /files/upload/app/routes/files-big.js- Guard the same path on the upload API