From: Roland Häder Date: Sun, 13 Oct 2024 14:01:17 +0000 (+0200) Subject: Contionued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0d56bc43d78457dd151810143c349edf9776bad0;p=fba.git Contionued: - moved static array from code (body) to header --- 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,