From 9c8a845fb3a617c01fddd5e349f6310d82c32eec Mon Sep 17 00:00:00 2001 From: Alexander Kozlovsky Date: Wed, 27 Mar 2024 11:13:53 +0100 Subject: [PATCH] Fix "ValueError: Can redirect only to http or https" in query_http_uri --- .../core/components/libtorrent/restapi/torrentinfo_endpoint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tribler/core/components/libtorrent/restapi/torrentinfo_endpoint.py b/src/tribler/core/components/libtorrent/restapi/torrentinfo_endpoint.py index e359c865cb2..4055c46ed4a 100644 --- a/src/tribler/core/components/libtorrent/restapi/torrentinfo_endpoint.py +++ b/src/tribler/core/components/libtorrent/restapi/torrentinfo_endpoint.py @@ -100,7 +100,8 @@ async def get_torrent_info(self, request): elif scheme in (HTTP_SCHEME, HTTPS_SCHEME): try: response = await query_http_uri(uri) - except (ServerConnectionError, ClientResponseError, SSLError, ClientConnectorError, AsyncTimeoutError) as e: + except (ServerConnectionError, ClientResponseError, SSLError, ClientConnectorError, AsyncTimeoutError, + ValueError) as e: self._logger.warning(f'Error while querying http uri: {e}') return RESTResponse({"error": str(e)}, status=HTTP_INTERNAL_SERVER_ERROR)