]> git.ipfire.org Git - dbl.git/commitdiff
sources: Strip any excess whitespace after the comments have been removed
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 3 Jan 2026 13:32:01 +0000 (13:32 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 3 Jan 2026 13:32:01 +0000 (13:32 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/dnsbl/sources.py

index 01868ace740fd9f909a4aa24f01d490fe05d6fdd..c3fcd99a554dd987ce11fac47f1b89b086e0e02a 100644 (file)
@@ -222,11 +222,12 @@ class Source(sqlmodel.SQLModel, database.BackendMixin, table=True):
 
                                                # Add all domains
                                                for line in f:
-                                                       line = line.rstrip()
-
                                                        # Strip any comments
                                                        line, hashtag, comment = line.partition("#")
 
+                                                       # Strip away any whitespace
+                                                       line = line.strip()
+
                                                        # Skip the line if it is empty
                                                        if not line:
                                                                continue