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

Local Middleware Not Working with route_dynamic in Crow #933

Open
rem0obb opened this issue Oct 28, 2024 · 0 comments
Open

Local Middleware Not Working with route_dynamic in Crow #933

rem0obb opened this issue Oct 28, 2024 · 0 comments
Labels
discussion The viability / implementation of the issue is up for debate feature Code based project improvement

Comments

@rem0obb
Copy link

rem0obb commented Oct 28, 2024

I'm currently using Crow extensively for a project. After doing some research in the Crow repository and reviewing code and related issues, particularly Issue #717, I noticed a limitation: it seems that local middlewares cannot be applied using route_dynamic, especially when working with WebSocket protocols or standard web usage patterns.

For example:

app.route_dynamic(url)
   .middlewares<crow::App<middleware::websocket::JWTAuth>, middleware::websocket::JWTAuth>()
   .websocket(&app);

Based on my testing, the middleware isn’t properly applied within route_dynamic. This issue affects both WebSocket connections and regular web routes, making it difficult to implement route-specific logic like authentication or authorization using local middleware.

@gittiver gittiver added feature Code based project improvement discussion The viability / implementation of the issue is up for debate labels Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion The viability / implementation of the issue is up for debate feature Code based project improvement
Projects
None yet
Development

No branches or pull requests

2 participants