Fixed multer file parsing bug
All checks were successful
armco-org/node-starter-kit/pipeline/head This commit looks good
All checks were successful
armco-org/node-starter-kit/pipeline/head This commit looks good
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user