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

Middleware addition is broken on sanic 22.12.0+ #92

Open
Zerogoki00 opened this issue Jan 10, 2023 · 1 comment
Open

Middleware addition is broken on sanic 22.12.0+ #92

Zerogoki00 opened this issue Jan 10, 2023 · 1 comment

Comments

@Zerogoki00
Copy link

Zerogoki00 commented Jan 10, 2023

In sanic 22.12.0 they changed the internal structure of app's middleware collections (request_middleware, response_middleware)

Look at this commit: sanic-org/sanic@2abe66b
Now they don't store pure middleware functions there but instead they use Middleware class for each of them.

It still works somehow but looks like middleware order is broken and other unpredictable bugs may occur.

Why don't you just use register_middleware method as suggested in docs? (https://sanic.dev/en/guide/basics/middleware.html#attaching-middleware)

@Zerogoki00
Copy link
Author

Please take a look at my pr which fixes it: #93

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

No branches or pull requests

1 participant