Skip to content

Custom middleware #3553

Closed
Closed

Description

@tananga

Problem to Solve

Hey! I would like each request to Serverpod to include the application version installed on the device and, for example, if the application version is old, not return data or return some specific error. Is it possible to add custom middleware to all requests?

Proposal

Implement custom middleware

Use Case

I dont wanna check user app version in every single endpoint. Thats to much works

Alternatives

Manual check on every endpoint :(

Additional context

No response

How experienced are you with this library?

Intermediate - Familiar with the basics or have used it in a few projects

Are you interested in working on a PR for this?

  • I want to work on this

Activity

  1. added
    enhancement
    on May 18, 2025
  2. SandPod commented on May 19, 2025

    @SandPod
    Contributor

    Hey @tananga 👋

    We don't currently have a mechanism for this.

    If I understand you correctly, you want this feature to be able to detect when old clients are sending requests to your server, and be able to "reject" or send a custom response in that case?

    Does this existing issue already cover that case? #1711

    Or are you looking for a more generalized solution?

  3. added
    area: endpoints
    in triage
    on May 19, 2025
  4. tananga commented on May 19, 2025

    @tananga
    Author

    Keeping versions in sync is super important but I would like to keep this issue open for more customs middlewares. Im sure that a lot of people need it.

  5. moved this from Backlog 🗂️ to Done 🚀 in Serverpod Frameworkson Oct 7, 2025
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

    area: endpointsenhancementin triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions