From 8a265242c9af10a9cc2d9ad1f3d785f5cf603608 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 4 Jul 2023 18:27:51 +0200 Subject: [PATCH] Continued: - raise_on() on obfuscated domains was a wrong decision --- fba/models/instances.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fba/models/instances.py b/fba/models/instances.py index bb8d1fe..1294a01 100644 --- a/fba/models/instances.py +++ b/fba/models/instances.py @@ -118,7 +118,7 @@ def update_data(domain: str): fields.append(_pending[key][domain]) sql_string += f" {key} = ?," - logger.debug("sql_string()=%d", len(sql_string)) + logger.debug("sql_string(%d)='%s'", len(sql_string), sql_string) if sql_string == "": raise ValueError(f"No fields have been set, but method invoked, domain='{domain}'") @@ -313,7 +313,6 @@ def is_recent(domain: str, column: str = "last_instance_fetch") -> bool: def deobfuscate(char: str, domain: str, blocked_hash: str = None) -> tuple: logger.debug("char='%s',domain='%s',blocked_hash='%s' - CALLED!", char, domain, blocked_hash) - domain_helper.raise_on(domain) if not isinstance(char, str): raise ValueError(f"Parameter char[]='{type(char)}' is not of type 'str'") @@ -321,6 +320,10 @@ def deobfuscate(char: str, domain: str, blocked_hash: str = None) -> tuple: raise ValueError("Parameter 'char' is empty") elif not char in domain: raise ValueError(f"char='{char}' not found in domain='{domain}' but function invoked") + elif not isinstance(domain, str): + raise ValueError(f"Parameter domain[]='%s'", type(domain)) + elif domain == "": + raise ValueError("Parameter 'domain' is empty") elif not isinstance(blocked_hash, str) and blocked_hash is not None: raise ValueError(f"Parameter blocked_hash[]='{type(blocked_hash)}' is not of type 'str'") -- 2.39.5