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:
|
Returns:
|
||||||
True if the hostname is syntactically valid.
|
True if the hostname is syntactically valid.
|
||||||
"""
|
"""
|
||||||
if len(host) > 253:
|
|
||||||
return False
|
|
||||||
if host.endswith("."):
|
if host.endswith("."):
|
||||||
host = host[:-1]
|
host = host[:-1]
|
||||||
|
if len(host) > 253:
|
||||||
|
return False
|
||||||
parts = host.split(".")
|
parts = host.split(".")
|
||||||
if len(parts) < 2 and not allow_single_label:
|
if len(parts) < 2 and not allow_single_label:
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue