Skip to content

Middleware pipeline #1906

Closed
Closed

Description

@bpamiri

Phase 1 — Modernization Target #1

Add a global and route-scoped middleware pipeline that runs before/after the controller filter chain, replacing ad-hoc plugin mixins for cross-cutting concerns.

Design

  • Middleware CFC implements handle(request, next) contract
  • wheels.middleware.Pipeline chains middleware with a next closure
  • Dispatch.cfc:$request() wraps controller dispatch in the pipeline
  • middleware parameter on Mapper route definitions
  • Ship built-in: RequestId, Cors, SecurityHeaders

Backwards Compatibility

Existing controller filters() continue to work unchanged. Middleware runs at the dispatch level (before controller instantiation), while filters run inside the controller.

See design_docs/MODERNIZE-WHEELS-RIM.md §4.1 for full implementation plan.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions