]> git.mxchange.org Git - fba.git/blobdiff - fba/helpers/domain.py
Continued:
[fba.git] / fba / helpers / domain.py
index 1830e3f41243a0926c6dd9c4485d8f074d49d41e..dd4e214c62ad543fea15e09f05358980594fac59 100644 (file)
@@ -47,14 +47,15 @@ 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")
 
-    components = urlparse(url)
     punycode = domain.encode("idna").decode("utf-8")
 
+    components = urlparse(url)
     logger.debug("components[]='%s',punycode='%s'", type(components), punycode)
+
     is_found = (punycode in [components.netloc, components.hostname])
 
     logger.debug("is_found='%s' - EXIT!", is_found)