1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-26 16:45:52 +00:00

htpasswd: ignore comments

This commit is contained in:
Unrud 2017-08-17 06:46:40 +02:00
parent 73038e518a
commit f912642c20
2 changed files with 4 additions and 1 deletions

View file

@ -216,7 +216,7 @@ class Auth(BaseAuth):
with open(self.filename) as f:
for line in f:
line = line.rstrip("\n")
if line.lstrip():
if line.lstrip() and not line.lstrip().startswith("#"):
try:
login, hash_value = line.split(":", maxsplit=1)
# Always compare both login and password to avoid