Skip to content

Commit

Permalink
Add BaseHTTPMiddleware import on docs (encode#1285)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 authored Sep 16, 2021
1 parent eebb465 commit 1ae43b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1ae43b4

Please sign in to comment.