ident fix (due to merge) ((really this time))

This commit is contained in:
OniriCorpe 2024-03-11 04:06:02 +01:00
parent 8154a86f4c
commit d3609c6b6a

View file

@ -1575,22 +1575,22 @@ class Configurations(TestSuite):
yield Warning("Can't open/read %s: %s" % (os.path.join(path, filename), e)) yield Warning("Can't open/read %s: %s" % (os.path.join(path, filename), e))
return return
for number, line in enumerate(content.split("\n"), 1): for number, line in enumerate(content.split("\n"), 1):
comment = ("#", "//", ";", "/**", "*") comment = ("#", "//", ";", "/**", "*")
if ( if (
( "0.0.0.0" in line or "::" in line ) ( "0.0.0.0" in line or "::" in line )
and not line.strip().startswith(comment) and not line.strip().startswith(comment)
): ):
for ip in re.split("[ \t,='\"(){}\[\]]", line): for ip in re.split("[ \t,='\"(){}\[\]]", line):
if ip == "::" or ip.startswith("0.0.0.0"): if ip == "::" or ip.startswith("0.0.0.0"):
yield Info( yield Info(
f"{os.path.relpath(path, app.path)}/{filename}:{number}: " f"{os.path.relpath(path, app.path)}/{filename}:{number}: "
"Binding to '0.0.0.0' or '::' can result in a security issue " "Binding to '0.0.0.0' or '::' can result in a security issue "
"as the reverse proxy and the SSO can be bypassed by knowing " "as the reverse proxy and the SSO can be bypassed by knowing "
"a public IP (typically an IPv6) and the app port. " "a public IP (typically an IPv6) and the app port. "
"Please be sure that this behavior is intentional. " "Please be sure that this behavior is intentional. "
"Maybe use '127.0.0.1' or '::1' instead." "Maybe use '127.0.0.1' or '::1' instead."
) )
############################################# #############################################
# __ __ _ __ _ # # __ __ _ __ _ #