22
22
from fastapi .middleware .cors import CORSMiddleware
23
23
from fastapi .responses import PlainTextResponse
24
24
from pip ._internal .operations .freeze import freeze
25
- from pydantic import BaseModel , HttpUrl
25
+ from pydantic import BaseModel
26
26
from starlette .responses import JSONResponse
27
27
28
28
from aleph .sdk .chains .remote import RemoteAccount
@@ -198,7 +198,7 @@ async def connect_ipv6():
198
198
return {"result" : False , "reason" : str (error .args [0 ])}
199
199
200
200
201
- async def check_url (internet_host : HttpUrl , timeout_seconds : int = 5 , socket_family = socket .AF_INET ):
201
+ async def check_url (internet_host : str , timeout_seconds : int = 5 , socket_family = socket .AF_INET ):
202
202
"""Check the connectivity of a single URL."""
203
203
timeout = aiohttp .ClientTimeout (total = timeout_seconds )
204
204
tcp_connector = aiohttp .TCPConnector (family = socket_family )
@@ -215,10 +215,10 @@ async def check_url(internet_host: HttpUrl, timeout_seconds: int = 5, socket_fam
215
215
@app .get ("/internet" )
216
216
async def read_internet ():
217
217
"""Check Internet connectivity of the system, requiring IP connectivity, domain resolution and HTTPS/TLS."""
218
- internet_hosts : list [HttpUrl ] = [
219
- HttpUrl ( url = "https://aleph.im/" , scheme = "https" ) ,
220
- HttpUrl ( url = "https://ethereum.org/en/" , scheme = "https" ) ,
221
- HttpUrl ( url = "https://ipfs.io/" , scheme = "https" ) ,
218
+ internet_hosts : list [str ] = [
219
+ "https://aleph.im/" ,
220
+ "https://ethereum.org/en/" ,
221
+ "https://ipfs.io/" ,
222
222
]
223
223
timeout_seconds = 5
224
224
0 commit comments