]> git.mxchange.org Git - fba.git/commitdiff
Contionued:
authorRoland Häder <roland@mxchange.org>
Sun, 13 Oct 2024 14:01:17 +0000 (16:01 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 13 Oct 2024 14:01:17 +0000 (16:01 +0200)
- moved static array from code (body) to header

fba/http/nodeinfo.py

index 979173eba078b9874a5041bbc644b435f65ea175..db89b212c956e36375878d50a93a1b03a4b56bb2 100644 (file)
@@ -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,