Skip to content

compatibility with middlewares #93

@jymchng

Description

@jymchng

one way to be compatible with middleware through async def dispatch(req: Request, call_next) is to make a factory function that is what that get sent to fastapi for deps resolution with the signature of def <some-name>(<some-generated-req-param-name>: Request): ..., then in the body of asyc def dispatch, user can do something like shield_result = await some_shield(request) and do whatever they want with the shield_result and call_next.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions