From 071ec3f322114530c9dca1525b7d3b11cdccee01 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Fri, 3 May 2024 21:24:51 -0400 Subject: [PATCH] Update applications.py --- fastapi/applications.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fastapi/applications.py b/fastapi/applications.py index 7fef5a35e..b71107eaa 100644 --- a/fastapi/applications.py +++ b/fastapi/applications.py @@ -4523,7 +4523,10 @@ class FastAPI(Starlette): @app.middleware("http") - async def add_process_time_header(request: Request, call_next: Callable[[Request], Awaitable[Response]): + async def add_process_time_header( + request: Request, + call_next: Callable[[Request], Awaitable[Response] + ) -> Response: start_time = time.time() response = await call_next(request) process_time = time.time() - start_time