Conditional Middleware #216
Replies: 3 comments 1 reply
-
This seems to work. Maybe add a section on the website under middleware as custom middleware?
|
Beta Was this translation helpful? Give feedback.
-
This seems to be a relatively common functional requirement, so I added https://github.com/salvo-rs/salvo/blob/main/crates/core/src/routing/router.rs#L223-L231 |
Beta Was this translation helpful? Give feedback.
-
Hi @chrislearn How can I implement Basic Auth or another middleware in my handler so that it is only applied when necessary, and the need for this authentication is determined dynamically within the request, for example, when retrieving information from the database? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to have conditional middleware prior to executing the main handler, something like request.next?
Beta Was this translation helpful? Give feedback.
All reactions