Properly strip newlines at end of filename
authorMagnus Hagander <magnus@hagander.net>
Thu, 4 Sep 2025 19:25:16 +0000 (21:25 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 4 Sep 2025 19:25:34 +0000 (21:25 +0200)
tools/purgehook/purgehook.py

index 73550dc18e32e9488bf02e95bc3b2fa41d798a84..53be5188337f61c8e5f24a3f410011a808971134 100755 (executable)
@@ -49,7 +49,7 @@ if __name__ == "__main__":
             })
 
             # If it's a CSS file, we also need to purge /dyncss/
-            if l.endswith('.css'):
+            if l.strip().endswith('.css'):
                 curs.execute("SELECT varnish_purge('^/dyncss/')")
         elif l.startswith('data/'):
             # Data files map to xkeys with the same name as the file prefixed by data_