diff --git a/src/http/routing/route-registry.ts b/src/http/routing/route-registry.ts index 9469502..689c877 100644 --- a/src/http/routing/route-registry.ts +++ b/src/http/routing/route-registry.ts @@ -449,6 +449,7 @@ export class RouteRegistry { * Execute a route handler with middleware pipeline * * Executes the full middleware pipeline: + * 0. CORS - Handle CORS headers and preflight * 1. Guards - Authorization checks * 2. Body parsing - Parse request body if present * 3. Pipes - Transform/validate body diff --git a/src/websocket/decorators/param-decorator.utils.ts b/src/websocket/decorators/param-decorator.utils.ts index 6710e22..95ac58a 100644 --- a/src/websocket/decorators/param-decorator.utils.ts +++ b/src/websocket/decorators/param-decorator.utils.ts @@ -71,9 +71,8 @@ export function createParamDecorator( ]; // Check if this parameter index already has metadata - const existingIndex = existingParams.findIndex((p) => p.index === parameterIndex); - if (existingIndex !== -1) { - const existing = existingParams[existingIndex]; + const existing = existingParams.find((p) => p.index === parameterIndex); + if (existing) { const existingDecoratorName = PARAM_TYPE_TO_DECORATOR_NAME[existing.type]; throw new Error( `${decoratorName} decorator: parameter at index ${parameterIndex} already has @${existingDecoratorName} decorator applied. ` +