Skip to main content
Version: 1.8.0

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 guard
  • app/routes/documents.js - Guard document create
  • app/routes/files.js - Guard POST /files/upload/
  • app/routes/files-big.js - Guard the same path on the upload API