Add BaseHTTPMiddleware import on docs (#1285)

This commit is contained in:
Lukas Kahwe Smith 2021-09-16 14:48:32 +02:00 committed by GitHub
parent eebb46529b
commit 1ae43b45b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -183,6 +183,8 @@ To implement a middleware class using `BaseHTTPMiddleware`, you must override th
`async def dispatch(request, call_next)` method.
```python
from starlette.middleware.base import BaseHTTPMiddleware
class CustomHeaderMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request, call_next):
response = await call_next(request)