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
54from starlette .middleware .base import RequestResponseEndpoint
65
76from debug_toolbar .types import ServerTiming , Stats
@@ -67,11 +66,11 @@ def content(self) -> str:
6766 def render (self , ** context : t .Any ) -> str :
6867 return self .toolbar .render (self .template , ** context )
6968
70- def url_for (self , name : str , ** path_params : t .Any ) -> URL :
71- return self .toolbar .request .url_for (name , ** path_params )
69+ def url_for (self , name : str , ** path_params : t .Any ) -> str :
70+ return str ( self .toolbar .request .url_for (name , ** path_params ) )
7271
7372 @property
74- def scripts (self ) -> t .List [URL ]:
73+ def scripts (self ) -> t .List [str ]:
7574 return []
7675
7776 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
65
76from debug_toolbar .panels import Panel
87from debug_toolbar .types import ServerTiming , Stats
@@ -46,7 +45,7 @@ def content(self) -> str:
4645 return self .render (rows = rows )
4746
4847 @property
49- def scripts (self ) -> t .List [URL ]:
48+ def scripts (self ) -> t .List [str ]:
5049 scripts = super ().scripts
5150 scripts .append (self .url_for ("debug_toolbar.static" , path = "js/timer.js" ))
5251 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
54
65from debug_toolbar .panels import Panel
76from debug_toolbar .types import Stats
@@ -16,7 +15,7 @@ def nav_subtitle(self) -> str:
1615 return f"FastAPI { __version__ } "
1716
1817 @property
19- def scripts (self ) -> t .List [URL ]:
18+ def scripts (self ) -> t .List [str ]:
2019 scripts = super ().scripts
2120 scripts .append (self .url_for ("debug_toolbar.static" , path = "js/versions.js" ))
2221 return scripts
You can’t perform that action at this time.
0 commit comments