From 0d56bc43d78457dd151810143c349edf9776bad0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 13 Oct 2024 16:01:17 +0200 Subject: [PATCH] Contionued: - moved static array from code (body) to header --- fba/http/nodeinfo.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fba/http/nodeinfo.py b/fba/http/nodeinfo.py index 979173e..db89b21 100644 --- a/fba/http/nodeinfo.py +++ b/fba/http/nodeinfo.py @@ -30,6 +30,12 @@ from fba.models import instances logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) +# Well-known URLs for nodeinfo informations +_well_known_nodeinfo_urls = [ + "/.well-known/x-nodeinfo2", + "/.well-known/nodeinfo", +] + # Request paths _request_paths = [ "/nodeinfo/2.1.json", @@ -160,7 +166,7 @@ def fetch_wellknown_nodeinfo(domain: str) -> dict: data = dict() logger.debug("Fetching .well-known info for domain='%s'", domain) - for path in ["/.well-known/x-nodeinfo2", "/.well-known/nodeinfo"]: + for path in _well_known_nodeinfo_urls: logger.debug("Fetching path='%s' from domain='%s' ...", path, domain) data = network.get_json_api( domain, -- 2.39.5