Skip to content

Document CORS step in middleware pipeline #190

Closed

Description

@VikramAditya33

The JSDoc for RouteRegistry.executeHandler lists the middleware pipeline as steps 1–5, but the actual code executes CORS handling as step 0 before guards. This makes the documentation inconsistent with the inline code comment (// 0. Handle CORS if enabled).

Just add step 0 to the JSDoc:

/**
 * 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
 * 4. Handler - Execute route handler
 * 5. Exception filters - Handle errors
 *
 * @param handler - Route handler function
 * @param req - Request wrapper
 * @param res - Response wrapper
 * @param metadata - Optional middleware metadata
 */

Activity

  1. added this to the v2.1.0 milestone on May 23, 2026
  2. added
    documentation
    good first issue
    on May 23, 2026
  3. wahajahmed010 commented on May 28, 2026

    @wahajahmed010
    Contributor

    Hi! I'd like to work on this issue. Could you please assign it to me? I have a PR open (#199) that addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationgood first issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions