From 1ae43b45b508f0f160e7357d17e8214e30e98e05 Mon Sep 17 00:00:00 2001 From: Lukas Kahwe Smith Date: Thu, 16 Sep 2021 14:48:32 +0200 Subject: [PATCH] Add BaseHTTPMiddleware import on docs (#1285) --- docs/middleware.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/middleware.md b/docs/middleware.md index 7d1233d1..ecef6d6f 100644 --- a/docs/middleware.md +++ b/docs/middleware.md @@ -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)