]> git.mxchange.org Git - fba.git/blobdiff - fba/helpers/domain.py
Continued:
[fba.git] / fba / helpers / domain.py
index 5328e3f37eeddc8a25043b390249704a7486de82..a38847963c7ebcc71e36906341a35980688fd020 100644 (file)
@@ -47,7 +47,7 @@ def is_in_url(domain: str, url: str) -> bool:
     raise_on(domain)
 
     if not isinstance(url, str):
-        raise ValueError(f"Parameter url[]='%s' is not of type 'str'", type(url))
+        raise ValueError(f"Parameter url[]='{type(url)}' is not of type 'str'")
     elif url == "":
         raise ValueError("Parameter 'url' is empty")
 
@@ -55,7 +55,7 @@ def is_in_url(domain: str, url: str) -> bool:
     punycode = domain.encode("idna").decode("utf-8")
 
     logger.debug("components[]='%s',punycode='%s'", type(components), punycode)
-    is_found = (punycode == components.netloc or punycode == components.hostname)
+    is_found = (punycode in [components.netloc, components.hostname])
 
     logger.debug("is_found='%s' - EXIT!", is_found)
     return is_found