From 387d817644970a3e09819dd3e663c548abe5a229 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 18 Oct 2023 23:27:43 +0200 Subject: [PATCH] Continued: - more cases of empty strings --- fba/http/federation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fba/http/federation.py b/fba/http/federation.py index 92daf56..25ec633 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -286,7 +286,7 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str: app_name = doc.find("meta", {"name" : "application-name"}) logger.debug("generator[]='%s',site_name[]='%s',platform[]='%s',app_name[]='%s'", type(generator), type(site_name), type(platform), type(app_name)) - if isinstance(platform, bs4.element.Tag) and isinstance(platform.get("content"), str): + if isinstance(platform, bs4.element.Tag) and isinstance(platform.get("content"), str) and platform.get("content") != "": logger.debug("Found property=og:platform, domain='%s'", domain) software = tidyup.domain(platform.get("content")) @@ -294,7 +294,7 @@ def fetch_generator_from_path(domain: str, path: str = "/") -> str: if software is not None and software != "": logger.debug("domain='%s' has og:platform='%s' - Setting detection_mode=PLATFORM ...", domain, software) instances.set_detection_mode(domain, "PLATFORM") - elif isinstance(generator, bs4.element.Tag) and isinstance(generator.get("content"), str): + elif isinstance(generator, bs4.element.Tag) and isinstance(generator.get("content"), str) and generator.get("content") != "": logger.debug("Found generator meta tag: domain='%s'", domain) software = tidyup.domain(generator.get("content")) -- 2.39.5