Browse Source

Merge a4792b7723 into 460f8d2cc8

pull/15480/merge
Aaron Timony 13 hours ago
committed by GitHub
parent
commit
03a3a7e595
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 17
      docs/en/docs/tutorial/middleware.md

17
docs/en/docs/tutorial/middleware.md

@ -82,9 +82,20 @@ app.add_middleware(MiddlewareB)
This results in the following execution order:
* **Request**: MiddlewareB → MiddlewareA → route
* **Response**: route → MiddlewareA → MiddlewareB
```mermaid
sequenceDiagram
participant Client
participant B as Middleware B<br/>(added last · outermost)
participant A as Middleware A<br/>(added first · innermost)
participant App as FastAPI app
Client ->> B: Request
B ->> A: Request
A ->> App: Request
App -->> A: Response
A -->> B: Response
B -->> Client: Response
```
This stacking behavior ensures that middlewares are executed in a predictable and controllable order.

Loading…
Cancel
Save