Skip to content
Discussion options

You must be logged in to vote

I hope that with this last explanation I’m able to clear up all your doubts.
What you wrote about what you understood is all correct; I’d only add, for completeness, that the BaseHTTPMiddleware (the one you use via a decorator) was designed and implemented to provide a simple, ready-to-use tool, but over time it has led to a number of problems or limitations. Personally, I almost never use it and I always prefer a pure ASGI middleware.

As for the additional questions you asked, I’ll share a comment on each of the scenarios you used as examples.
Before starting with the examples, let me share a bit more information.

In FastAPI (and partly in Starlette), a middleware stack is built in the f…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by khirooo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
3 participants