File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import typing as t
22
33from fastapi import Request , Response
4+ from starlette .datastructures import URL
45from starlette .middleware .base import RequestResponseEndpoint
56
67from debug_toolbar .types import ServerTiming , Stats
@@ -66,11 +67,11 @@ def content(self) -> str:
6667 def render (self , ** context : t .Any ) -> str :
6768 return self .toolbar .render (self .template , ** context )
6869
69- def url_for (self , name : str , ** path_params : t .Any ) -> str :
70+ def url_for (self , name : str , ** path_params : t .Any ) -> URL :
7071 return self .toolbar .request .url_for (name , ** path_params )
7172
7273 @property
73- def scripts (self ) -> t .List [str ]:
74+ def scripts (self ) -> t .List [URL ]:
7475 return []
7576
7677 async def process_request (self , request : Request ) -> Response :
Original file line number Diff line number Diff line change 22from time import perf_counter
33
44from fastapi import Request , Response
5+ from starlette .datastructures import URL
56
67from debug_toolbar .panels import Panel
78from debug_toolbar .types import ServerTiming , Stats
@@ -45,7 +46,7 @@ def content(self) -> str:
4546 return self .render (rows = rows )
4647
4748 @property
48- def scripts (self ) -> t .List [str ]:
49+ def scripts (self ) -> t .List [URL ]:
4950 scripts = super ().scripts
5051 scripts .append (self .url_for ("debug_toolbar.static" , path = "js/timer.js" ))
5152 return scripts
Original file line number Diff line number Diff line change 11import typing as t
22
33from fastapi import Request , Response , __version__
4+ from starlette .datastructures import URL
45
56from debug_toolbar .panels import Panel
67from debug_toolbar .types import Stats
@@ -15,7 +16,7 @@ def nav_subtitle(self) -> str:
1516 return f"FastAPI { __version__ } "
1617
1718 @property
18- def scripts (self ) -> t .List [str ]:
19+ def scripts (self ) -> t .List [URL ]:
1920 scripts = super ().scripts
2021 scripts .append (self .url_for ("debug_toolbar.static" , path = "js/versions.js" ))
2122 return scripts
You can’t perform that action at this time.
0 commit comments