Skip to content

Commit 4d90ac5

Browse files
committed
ensure type hints are correct in profiling middleware
1 parent f442e63 commit 4d90ac5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/service-library/src/servicelib/fastapi/profiler_middleware.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from typing import Any, Final
22

3-
from fastapi import FastAPI
43
from servicelib.aiohttp import status
54
from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON
65
from starlette.requests import Request
6+
from starlette.types import ASGIApp, Receive, Scope, Send
77

88
from ..utils_profiling_middleware import (
99
_is_profiling,
@@ -31,11 +31,11 @@ class ProfilerMiddleware:
3131
https://fastapi.tiangolo.com/advanced/middleware/#advanced-middleware
3232
"""
3333

34-
def __init__(self, app: FastAPI):
35-
self._app: FastAPI = app
34+
def __init__(self, app: ASGIApp):
35+
self._app = app
3636
self._profile_header_trigger: Final[str] = "x-profile"
3737

38-
async def __call__(self, scope, receive, send):
38+
async def __call__(self, scope: Scope, receive: Receive, send: Send):
3939
if scope["type"] != "http":
4040
await self._app(scope, receive, send)
4141
return

0 commit comments

Comments
 (0)