Fixed multer file parsing bug
All checks were successful
armco-org/node-starter-kit/pipeline/head This commit looks good

This commit is contained in:
2025-12-17 20:14:41 +05:30
parent f8ece69b56
commit bdd86e35b2
2 changed files with 9 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@armco/node-starter-kit",
"version": "2.0.3",
"version": "2.0.4",
"description": "Modern plugin-based starter kit for Node.js applications with TypeScript, security, and observability",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@@ -52,7 +52,14 @@ export async function initMulter(app: Application, config: MulterConfig, logger?
const qualifyingRoutes = ar.routes.map((r) => (typeof r === 'string' ? r : r.route))
const handler = (req: Request, res: Response, next: NextFunction) => {
const routeConfig = ar.routes.find((rc) => req.baseUrl === (typeof rc === 'string' ? rc : rc.route))
// Build full path for matching (baseUrl + path)
const fullPath = (req.baseUrl || '') + (req.path || req.url || '')
// Find route config that matches the request path
const routeConfig = ar.routes.find((rc) => {
const configRoute = typeof rc === 'string' ? rc : rc.route
return fullPath.startsWith(configRoute)
})
if (!routeConfig) {
return next()