Skip to content

feat: optional middleware chain in run_rsgi before route match #11

Closed

Description

@ZhuchkaTriplesix

Context

  • No hook for metrics, CORS, or auth that runs before the router (except per-route JWT).

Design

  • App.add_middleware(f) where f(scope, protocol) -> Result<ControlFlow, …> in Rust, or a list of Py<PyAny> pre-handlers. Short-circuit to a response (e.g. 204 for OPTIONS preflight).

Scope

  • High complexity; start with a single optional Python callable for an MVP.

Acceptance criteria

  • Test that a CORS preflight can return 204 without hitting the route handler.

Research

  • CORS: Access-Control-Request-Method / Origin (Fetch).

Activity

  1. added this to the v0.2.0 milestone on Apr 26, 2026
  2. added a commit that references this issue on Apr 26, 2026
  3. linked a pull request that will close this issueDev #45on Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions