Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow middleware from plugins to be run before user middleware #2261

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

deer
Copy link
Contributor

@deer deer commented Jan 17, 2024

closes #2160

I was originally hoping for a cool way to absolutely order middleware. I wanted to add a name to plugin middleware, and then extract the name and use that to constrain an ordering object. But my typescript skills failed me.

So this is a more direct approach that solves the issue: just allow plugin middleware to go before user middleware. The idea is to add a new boolean to the config, and then if this is set, perform a secondary sort that looks at whether the middleware is created from a plugin.

Marvin, in #2056 you added a fixture_plugin_middleware fixture, but it looks unused! So I've repurposed it here with a new name to test this feature.

@deer deer mentioned this pull request Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide possibility to run plugin middleware before middlewares under routes/
1 participant