Skip to content

Commit

Permalink
Add missing Middleware import on BaseHTTPMiddleware section (#1844)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Sep 5, 2022
1 parent 1fa42a2 commit 9386bcf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/middleware.md
Expand Up @@ -190,8 +190,11 @@ To implement a middleware class using `BaseHTTPMiddleware`, you must override th
`async def dispatch(request, call_next)` method.

```python
from starlette.applications import Starlette
from starlette.middleware import Middleware
from starlette.middleware.base import BaseHTTPMiddleware


class CustomHeaderMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request, call_next):
response = await call_next(request)
Expand Down

0 comments on commit 9386bcf

Please sign in to comment.