mirror of https://github.com/OWASP/Nettacker.git
trim dot before checking the length
Signed-off-by: Aarush289 <cs24b064@smail.iitm.ac.in>
This commit is contained in:
parent
d85260924a
commit
4de4cca71f
|
|
@ -36,10 +36,10 @@ def valid_hostname(
|
|||
Returns:
|
||||
True if the hostname is syntactically valid.
|
||||
"""
|
||||
if len(host) > 253:
|
||||
return False
|
||||
if host.endswith("."):
|
||||
host = host[:-1]
|
||||
if len(host) > 253:
|
||||
return False
|
||||
parts = host.split(".")
|
||||
if len(parts) < 2 and not allow_single_label:
|
||||
return False
|
||||
|
|
|
|||
Loading…
Reference in New Issue