From d06cabbc57019af13e12940fb54d0b9583269ba4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 28 Nov 2023 01:40:23 +0100 Subject: [PATCH] Continued: - also skip empty 'href' values - include 'infos' array, too --- fba/http/nodeinfo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fba/http/nodeinfo.py b/fba/http/nodeinfo.py index b31e2ac..a0418dc 100644 --- a/fba/http/nodeinfo.py +++ b/fba/http/nodeinfo.py @@ -199,8 +199,8 @@ def fetch_wellknown_nodeinfo(domain: str) -> dict: elif "href" not in link: logger.warning("link[rel]='%s' has no element 'href' - SKIPPED!", link["rel"]) continue - elif link["href"] is None: - logger.debug("link[href] is None, link[rel]='%s' - SKIPPED!", link["rel"]) + elif link["href"] is None or link["href"] == "": + logger.debug("link[href]='%s',link[rel]='%s' - SKIPPED!", link["href"], link["rel"]) continue # Default is that 'href' has a complete URL, but some hosts don't send that @@ -255,7 +255,7 @@ def fetch_wellknown_nodeinfo(domain: str) -> dict: logger.debug("Marking domain='%s' as successfully handled ...", domain) instances.set_success(domain) else: - logger.warning("nodeinfo does not contain 'links' or 'server': domain='%s'", domain) + logger.warning("nodeinfo does not contain 'links' or 'server': domain='%s',infos[%s]='%s'", domain, type(infos), infos) logger.debug("Returning data[]='%s' - EXIT!", type(data)) return data -- 2.39.5