···11from urllib.parse import urlparse
22-import httpx
22+import aiohttp
334455# this is a crude/partial filter that looks at HTTPS URLs and checks if they seem "safe" for server-side requests (SSRF). This is only a partial mitigation, the actual HTTP client also needs to prevent other attacks and behaviors.
···303031313232class HardenedHttp:
3333- def get_session(self) -> httpx.AsyncClient:
3434- return httpx.AsyncClient(
3535- timeout=httpx.Timeout(20, connect=5),
3636- follow_redirects=False,
3333+ def get_session(self) -> aiohttp.ClientSession:
3434+ return aiohttp.ClientSession(
3535+ timeout=aiohttp.ClientTimeout(20, connect=5),
3736 headers={
3837 "User-Agent": "ligo.at/0",
3938 },